aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drm_bufs.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-10-25 20:21:43 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-25 20:21:43 -0700
commit82b6c3af0482c167fb3bb51375589e6d9c5c67a4 (patch)
tree4ee4ed76faadb309b499187ea7ae797db69abfd3 /drivers/char/drm/drm_bufs.c
parentMerge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6 (diff)
parentdrm: ioremap balanced with iounmap for drivers/char/drm (diff)
downloadlinux-dev-82b6c3af0482c167fb3bb51375589e6d9c5c67a4.tar.xz
linux-dev-82b6c3af0482c167fb3bb51375589e6d9c5c67a4.zip
Merge branch 'drm-patches' of master.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-patches' of master.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6: drm: ioremap balanced with iounmap for drivers/char/drm drm: fix error returns, sysfs error handling fix return code in error case. drm: mga: set dev_priv_size drm: savage: dev->agp_buffer_map is not initialized for AGP DMA on savages drm: radeon: only allow specific type-3 packetss through verifier
Diffstat (limited to 'drivers/char/drm/drm_bufs.c')
-rw-r--r--drivers/char/drm/drm_bufs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c
index 029baea33b62..6eafff13dab6 100644
--- a/drivers/char/drm/drm_bufs.c
+++ b/drivers/char/drm/drm_bufs.c
@@ -237,6 +237,8 @@ static int drm_addmap_core(drm_device_t * dev, unsigned int offset,
list = drm_alloc(sizeof(*list), DRM_MEM_MAPS);
if (!list) {
+ if (map->type == _DRM_REGISTERS)
+ drm_ioremapfree(map->handle, map->size, dev);
drm_free(map, sizeof(*map), DRM_MEM_MAPS);
return -EINVAL;
}
@@ -252,6 +254,8 @@ static int drm_addmap_core(drm_device_t * dev, unsigned int offset,
map->offset;
ret = drm_map_handle(dev, &list->hash, user_token, 0);
if (ret) {
+ if (map->type == _DRM_REGISTERS)
+ drm_ioremapfree(map->handle, map->size, dev);
drm_free(map, sizeof(*map), DRM_MEM_MAPS);
drm_free(list, sizeof(*list), DRM_MEM_MAPS);
mutex_unlock(&dev->struct_mutex);