summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_bufs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c
index e5d4c6bf..baa96305 100644
--- a/linux-core/drm_bufs.c
+++ b/linux-core/drm_bufs.c
@@ -373,7 +373,7 @@ int drm_rmmap_ioctl(struct inode *inode, struct file *filp,
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev;
drm_map_t request;
- drm_local_map_t *map;
+ drm_local_map_t *map = NULL;
struct list_head *list;
int ret;
@@ -401,6 +401,9 @@ int drm_rmmap_ioctl(struct inode *inode, struct file *filp,
return -EINVAL;
}
+ if (!map)
+ return -EINVAL;
+
/* Register and framebuffer maps are permanent */
if ((map->type == _DRM_REGISTERS) || (map->type == _DRM_FRAME_BUFFER)) {
up(&dev->struct_sem);