1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

drm/vc4: fix error code in vc4_create_object()

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: c826a6e106 ("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
This commit is contained in:
Dan Carpenter 2021-11-18 14:14:16 +03:00 committed by Maxime Ripard
parent b371fd131f
commit 96c5f82ef0
No known key found for this signature in database
GPG key ID: E3EF0D6F671851C5

View file

@ -391,7 +391,7 @@ struct drm_gem_object *vc4_create_object(struct drm_device *dev, size_t size)
bo = kzalloc(sizeof(*bo), GFP_KERNEL); bo = kzalloc(sizeof(*bo), GFP_KERNEL);
if (!bo) if (!bo)
return ERR_PTR(-ENOMEM); return NULL;
bo->madv = VC4_MADV_WILLNEED; bo->madv = VC4_MADV_WILLNEED;
refcount_set(&bo->usecnt, 0); refcount_set(&bo->usecnt, 0);