summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-11-18 14:14:16 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-12-01 09:27:42 +0100
commit482522c199844473cb851cf8b536a702ca095aa1 (patch)
treef3c09079914a937fc357b009fe00776d5a2ffa04
parent0d4b29eaadc1f59cec0c7e85eae77d08fcca9824 (diff)
downloadlinux-stable-482522c199844473cb851cf8b536a702ca095aa1.tar.gz
linux-stable-482522c199844473cb851cf8b536a702ca095aa1.tar.bz2
linux-stable-482522c199844473cb851cf8b536a702ca095aa1.zip
drm/vc4: fix error code in vc4_create_object()
[ Upstream commit 96c5f82ef0a145d3e56e5b26f2bf6dcd2ffeae1c ] The ->gem_create_object() functions are supposed to return NULL if there is an error. None of the callers expect error pointers so returing one will lead to an Oops. See drm_gem_vram_create(), for example. Fixes: c826a6e10644 ("drm/vc4: Add a BO cache.") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20211118111416.GC1147@kili Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/gpu/drm/vc4/vc4_bo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c
index 8dcce7182bb7..1e28ff981599 100644
--- a/drivers/gpu/drm/vc4/vc4_bo.c
+++ b/drivers/gpu/drm/vc4/vc4_bo.c
@@ -417,7 +417,7 @@ struct drm_gem_object *vc4_create_object(struct drm_device *dev, size_t size)
bo = kzalloc(sizeof(*bo), GFP_KERNEL);
if (!bo)
- return ERR_PTR(-ENOMEM);
+ return NULL;
bo->madv = VC4_MADV_WILLNEED;
refcount_set(&bo->usecnt, 0);