Skip to content

Commit

Permalink
drm: Fix the crash issue when user space drm application use drmPrime…
Browse files Browse the repository at this point in the history
…FDToHandle method to import dmabuf from other module

Signed-off-by: Andy Hu <andy.hu@starfivetech.com>
  • Loading branch information
andy.hu authored and andyhu-stf committed Feb 10, 2022
1 parent 68324b5 commit 3da8d33
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/gpu/drm/starfive/starfive_drm_gem.c
Expand Up @@ -106,6 +106,7 @@ starfive_drm_gem_alloc_object(struct drm_device *drm, unsigned int size)
if (!starfive_obj)
return ERR_PTR(-ENOMEM);

starfive_obj->base.funcs = &starfive_gem_object_funcs;
obj = &starfive_obj->base;
ret = drm_gem_object_init(drm, obj, round_up(size, PAGE_SIZE));
if (ret)
Expand Down Expand Up @@ -165,8 +166,6 @@ starfive_drm_gem_create_object(struct drm_device *drm, unsigned int size,
if (ret)
goto err_free_obj;

starfive_obj->base.funcs = &starfive_gem_object_funcs;

return starfive_obj;

err_free_obj:
Expand Down

0 comments on commit 3da8d33

Please sign in to comment.