The drm_gem_shmem_create() returns error pointers and v3d_bo_create() is
also supposed to return error pointers.
Fixes: 40609d4820b2 ("drm/v3d: Use the new shmem helpers to reduce driver boilerplate.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190321062731.GC21489@kadam
int ret;
shmem_obj = drm_gem_shmem_create(dev, unaligned_size);
- if (!shmem_obj)
- return NULL;
+ if (IS_ERR(shmem_obj))
+ return ERR_CAST(shmem_obj);
bo = to_v3d_bo(&shmem_obj->base);
ret = v3d_bo_create_finish(&shmem_obj->base);