From: Dan Carpenter <dan.carpenter@oracle.com>
To: Paul Cercueil <paul@crapouillou.net>
Cc: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Thomas Zimmermann <tzimmermann@suse.de>,
linux-mips@vger.kernel.org, dri-devel@lists.freedesktop.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH] drm/ingenic: fix error code in ingenic_drm_gem_create_object()
Date: Thu, 18 Nov 2021 14:15:22 +0300 [thread overview]
Message-ID: <20211118111522.GD1147@kili> (raw)
The ->gem_create_object() function pointers are supposed to return NULL
on error. This function returns an error pointer but none of the
callers expect that so it will lead to an Oops. See drm_gem_vram_create()
for example of it checks for NULL but an error pointer would lead to a
crash.
Fixes: 4a791cb6d34f ("drm/ingenic: Add option to alloc cached GEM buffers")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
index a5df1c8d34cd..eb7266a0b037 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -757,7 +757,7 @@ ingenic_drm_gem_create_object(struct drm_device *drm, size_t size)
obj = kzalloc(sizeof(*obj), GFP_KERNEL);
if (!obj)
- return ERR_PTR(-ENOMEM);
+ return NULL;
obj->map_noncoherent = priv->soc_info->map_noncoherent;
--
2.20.1
next reply other threads:[~2021-11-18 11:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-18 11:15 Dan Carpenter [this message]
2021-12-09 8:10 ` [PATCH] drm/ingenic: fix error code in ingenic_drm_gem_create_object() 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=20211118111522.GD1147@kili \
--to=dan.carpenter@oracle.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=paul@crapouillou.net \
--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