Skip to content

Commit

Permalink
drm/vc4: fix error code in vc4_create_object()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Dan Carpenter authored and mripard committed Nov 19, 2021
1 parent b371fd1 commit 96c5f82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/vc4/vc4_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,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);
Expand Down

0 comments on commit 96c5f82

Please sign in to comment.