diff options
author | Dave Airlie <airlied@optimus.localdomain> | 2006-12-19 16:39:13 +1100 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2006-12-19 16:41:10 +1100 |
commit | cc22cd8bde39f3e4be8ca9f726a773b0270ebdbc (patch) | |
tree | 180c0d11d6da5572fcb167d6f5e7130d41330e95 /linux-core | |
parent | b3c88d31e1e83458c6125a02b80f2e57ebcf750d (diff) |
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 'linux-core')
-rw-r--r-- | linux-core/drm_bufs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c index d6ebc8d1..1ff7c90b 100644 --- a/linux-core/drm_bufs.c +++ b/linux-core/drm_bufs.c @@ -279,6 +279,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_ioremap(map->handle, map->size, dev); drm_free(map, sizeof(*map), DRM_MEM_MAPS); return -EINVAL; } @@ -295,6 +297,8 @@ static int drm_addmap_core(drm_device_t * dev, unsigned int offset, ret = drm_map_handle(dev, &list->hash, user_token, 0); if (ret) { + if (map->type == _DRM_REGISTERS) + drm_ioremap(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); |