From: Dan Carpenter <error27@gmail.com>
To: Thierry Reding <treding@nvidia.com>,
Thomas Zimmermann <tzimmermann@suse.de>
Cc: kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org,
Javier Martinez Canillas <javierm@redhat.com>
Subject: [PATCH] drm/simpledrm: Fix an NULL vs IS_ERR() bug
Date: Thu, 26 Jan 2023 12:28:44 +0300 [thread overview]
Message-ID: <Y9JHzImRcUaa0mi1@kili> (raw)
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>
---
drivers/gpu/drm/tiny/simpledrm.c | 4 ++--
1 file 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 {
--
2.35.1
next reply other threads:[~2023-01-26 9:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-26 9:28 Dan Carpenter [this message]
2023-01-26 12:52 ` [PATCH] drm/simpledrm: Fix an NULL vs IS_ERR() bug Thomas Zimmermann
2023-01-26 16:18 ` Thierry Reding
2023-02-01 10:32 ` Thomas Zimmermann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y9JHzImRcUaa0mi1@kili \
--to=error27@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=javierm@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=treding@nvidia.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox