Commit fc0c77fc authored by Dan Carpenter's avatar Dan Carpenter Committed by Eric Anholt

drm/v3d: fix a NULL vs error pointer mixup

The drm_gem_shmem_create() returns error pointers and v3d_bo_create() is
also supposed to return error pointers.

Fixes: 40609d48 ("drm/v3d: Use the new shmem helpers to reduce driver boilerplate.")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
Reviewed-by: default avatarEric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190321062731.GC21489@kadam
parent 181e5bf2
...@@ -130,8 +130,8 @@ struct v3d_bo *v3d_bo_create(struct drm_device *dev, struct drm_file *file_priv, ...@@ -130,8 +130,8 @@ struct v3d_bo *v3d_bo_create(struct drm_device *dev, struct drm_file *file_priv,
int ret; int ret;
shmem_obj = drm_gem_shmem_create(dev, unaligned_size); shmem_obj = drm_gem_shmem_create(dev, unaligned_size);
if (!shmem_obj) if (IS_ERR(shmem_obj))
return NULL; return ERR_CAST(shmem_obj);
bo = to_v3d_bo(&shmem_obj->base); bo = to_v3d_bo(&shmem_obj->base);
ret = v3d_bo_create_finish(&shmem_obj->base); ret = v3d_bo_create_finish(&shmem_obj->base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment