Commit 9bdd9424 authored by Dan Carpenter's avatar Dan Carpenter Committed by Thomas Zimmermann

drm/simpledrm: Fix an NULL vs IS_ERR() bug

The devm_memremap() function doesn't return NULL, it returns error
pointers.

Fixes: 9a10c7e6 ("drm/simpledrm: Add support for system memory framebuffers")
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Reviewed-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/Y9JHzImRcUaa0mi1@kili
(cherry picked from commit e566507b)
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
parent aebd8f0c
......@@ -719,8 +719,8 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv,
drm_dbg(dev, "using system memory framebuffer at %pr\n", mem);
screen_base = devm_memremap(dev->dev, mem->start, resource_size(mem), MEMREMAP_WC);
if (!screen_base)
return ERR_PTR(-ENOMEM);
if (IS_ERR(screen_base))
return screen_base;
iosys_map_set_vaddr(&sdev->screen_base, screen_base);
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment