summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2023-01-26 10:28:44 +0100
committerThomas Zimmermann <tzimmermann@suse.de>2023-02-01 11:16:46 +0100
commit9bdd9424bfec5eebf38dd4928f2d171ec7b1a57e (patch)
treee5da13bd2dde6a4aab5c8eb91f87cfc5ea816de9 /drivers
parentMerge v6.2-rc6 into drm-next (diff)
downloadlinux-9bdd9424bfec5eebf38dd4928f2d171ec7b1a57e.tar.xz
linux-9bdd9424bfec5eebf38dd4928f2d171ec7b1a57e.zip
drm/simpledrm: Fix an NULL vs IS_ERR() bug
The devm_memremap() function doesn't return NULL, it returns error pointers. Fixes: 9a10c7e6519b ("drm/simpledrm: Add support for system memory framebuffers") Signed-off-by: Dan Carpenter <error27@gmail.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/Y9JHzImRcUaa0mi1@kili (cherry picked from commit e566507bf2f460967f53030ef84b67ef26dcaf8e) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/tiny/simpledrm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c
index 2acc0eb32489..63881a3754f8 100644
--- a/drivers/gpu/drm/tiny/simpledrm.c
+++ b/drivers/gpu/drm/tiny/simpledrm.c
@@ -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 {