Skip to content

Commit

Permalink
drm: ioremap return value checks
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Thompson <postfail <at> hushmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
  • Loading branch information
Scott Thompson authored and Dave Airlie committed Aug 25, 2007
1 parent 22c806c commit 0769d39
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/char/drm/drm_bufs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0769d39

Please sign in to comment.