From: Scott Thompson Date: Sat, 25 Aug 2007 08:17:49 +0000 (+1000) Subject: drm: ioremap return value checks X-Git-Tag: MMI-PSA29.97-13-9~40648^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0769d39c993145754852b517ddd9c11586f0a014;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 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);