diff options
author | Scott Thompson <postfail at hushmail.com> | 2007-08-25 12:17:49 +0400 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2007-08-25 12:17:49 +0400 |
commit | 0769d39c993145754852b517ddd9c11586f0a014 (patch) | |
tree | 8e8a404cb13a0bbb778b2f27f123d97e818e1c67 /drivers/char/drm/drm_bufs.c | |
parent | 22c806c23fe17f9c744d19edfe650cfd6496bc2a (diff) | |
download | linux-0769d39c993145754852b517ddd9c11586f0a014.tar.xz |
drm: ioremap return value checks
Signed-off-by: Scott Thompson <postfail <at> hushmail.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.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c index 3d1ec8234b8b..c115b39b8517 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); |