summaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drm_bufs.c
diff options
context:
space:
mode:
authorAmol Lad <amol@verismonetworks.com>2006-10-25 18:55:34 +0200
committerDave Airlie <airlied@linux.ie>2006-10-25 18:55:34 +0200
commit85abb3f95010b277a6efbc9b8031a7854af87e10 (patch)
treeede2f4e49d1bde65e8e12e7e919af2a179c9a613 /drivers/char/drm/drm_bufs.c
parentdrm: fix error returns, sysfs error handling (diff)
downloadlinux-85abb3f95010b277a6efbc9b8031a7854af87e10.tar.xz
linux-85abb3f95010b277a6efbc9b8031a7854af87e10.zip
drm: ioremap balanced with iounmap for drivers/char/drm
ioremap must be balanced by an iounmap and failing to do so can result in a memory leak. Tested (compilation only) to make sure the files are compiling without any warning/error due to new changes Signed-off-by: Amol Lad <amol@verismonetworks.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
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);