From 7ea4d4bd5e21380f028c3a6e2500655090a3f932 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 23 Jul 2007 10:00:51 +0200 Subject: drm_rmmap_ioctl(): remove dead code This patch removes some obviously dead code spotted by the Coverity checker. Signed-off-by: Adrian Bunk Signed-off-by: Dave Airlie diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c index 923174c..3d1ec82 100644 --- a/drivers/char/drm/drm_bufs.c +++ b/drivers/char/drm/drm_bufs.c @@ -479,11 +479,6 @@ int drm_rmmap_ioctl(struct inode *inode, struct file *filp, return -EINVAL; } - if (!map) { - mutex_unlock(&dev->struct_mutex); - return -EINVAL; - } - /* Register and framebuffer maps are permanent */ if ((map->type == _DRM_REGISTERS) || (map->type == _DRM_FRAME_BUFFER)) { mutex_unlock(&dev->struct_mutex); -- cgit v0.10.2 From 22c806c23fe17f9c744d19edfe650cfd6496bc2a Mon Sep 17 00:00:00 2001 From: Simon Farnsworth Date: Mon, 23 Jul 2007 18:32:01 +1000 Subject: drm/via: Fix dmablit when blit queue is full fd.o bug 11542 Acked-by: Thomas Hellstrom Signed-off-by: Dave Airlie diff --git a/drivers/char/drm/via_dmablit.c b/drivers/char/drm/via_dmablit.c index 832de1d..3dd1ed3 100644 --- a/drivers/char/drm/via_dmablit.c +++ b/drivers/char/drm/via_dmablit.c @@ -560,7 +560,7 @@ via_init_dmablit(struct drm_device *dev) blitq->head = 0; blitq->cur = 0; blitq->serviced = 0; - blitq->num_free = VIA_NUM_BLIT_SLOTS; + blitq->num_free = VIA_NUM_BLIT_SLOTS - 1; blitq->num_outstanding = 0; blitq->is_active = 0; blitq->aborting = 0; -- cgit v0.10.2 From 0769d39c993145754852b517ddd9c11586f0a014 Mon Sep 17 00:00:00 2001 From: Scott Thompson Date: Sat, 25 Aug 2007 18:17:49 +1000 Subject: drm: ioremap return value checks Signed-off-by: Scott Thompson hushmail.com> Signed-off-by: Dave Airlie diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c index 3d1ec82..c115b39 100644 --- a/drivers/char/drm/drm_bufs.c +++ b/drivers/char/drm/drm_bufs.c @@ -177,8 +177,14 @@ static int drm_addmap_core(struct drm_device * dev, unsigned int offset, MTRR_TYPE_WRCOMB, 1); } } - if (map->type == _DRM_REGISTERS) + if (map->type == _DRM_REGISTERS) { map->handle = ioremap(map->offset, map->size); + if (!map->handle) { + drm_free(map, sizeof(*map), DRM_MEM_MAPS); + return -ENOMEM; + } + } + break; case _DRM_SHM: list = drm_find_matching_map(dev, map); -- cgit v0.10.2