summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandy.hu <andy.hu@starfive.com>2021-11-23 11:56:30 +0300
committerAndy Hu <andy.hu@starfivetech.com>2022-02-10 10:21:29 +0300
commit3da8d33cc93b434f1cc356c391095d458ca82a04 (patch)
tree1bb072ef472f4d64ff187668e2fcac056a16858d
parent68324b5a97bce25584dd7317287b2c0b19d2ec9d (diff)
downloadlinux-3da8d33cc93b434f1cc356c391095d458ca82a04.tar.xz
drm: Fix the crash issue when user space drm application use drmPrimeFDToHandle method to import dmabuf from other module
Signed-off-by: Andy Hu <andy.hu@starfivetech.com>
-rw-r--r--drivers/gpu/drm/starfive/starfive_drm_gem.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/starfive/starfive_drm_gem.c b/drivers/gpu/drm/starfive/starfive_drm_gem.c
index c2a2966b4936..12fecc57b4e1 100644
--- a/drivers/gpu/drm/starfive/starfive_drm_gem.c
+++ b/drivers/gpu/drm/starfive/starfive_drm_gem.c
@@ -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)
@@ -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: