aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/drm/drm_bufs.c8
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,
177 MTRR_TYPE_WRCOMB, 1); 177 MTRR_TYPE_WRCOMB, 1);
178 } 178 }
179 } 179 }
180 if (map->type == _DRM_REGISTERS) 180 if (map->type == _DRM_REGISTERS) {
181 map->handle = ioremap(map->offset, map->size); 181 map->handle = ioremap(map->offset, map->size);
182 if (!map->handle) {
183 drm_free(map, sizeof(*map), DRM_MEM_MAPS);
184 return -ENOMEM;
185 }
186 }
187
182 break; 188 break;
183 case _DRM_SHM: 189 case _DRM_SHM:
184 list = drm_find_matching_map(dev, map); 190 list = drm_find_matching_map(dev, map);