提交 0769d39c 编写于 作者: S Scott Thompson 提交者: Dave Airlie

drm: ioremap return value checks

Signed-off-by: Scott Thompson <postfail <at> hushmail.com>
Signed-off-by: NDave Airlie <airlied@linux.ie>
上级 22c806c2
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册