Skip to content

Commit b33c5c8

Browse files
Dan Carpentergregkh
authored andcommitted
drm/vc4: fix error code in vc4_create_object()
[ Upstream commit 96c5f82 ] 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: c826a6e ("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>
1 parent 2bf9c5a commit b33c5c8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/gpu/drm/vc4/vc4_bo.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ struct drm_gem_object *vc4_create_object(struct drm_device *dev, size_t size)
389389

390390
bo = kzalloc(sizeof(*bo), GFP_KERNEL);
391391
if (!bo)
392-
return ERR_PTR(-ENOMEM);
392+
return NULL;
393393

394394
bo->madv = VC4_MADV_WILLNEED;
395395
refcount_set(&bo->usecnt, 0);

0 commit comments

Comments
 (0)