diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2021-10-13 11:11:33 +0300 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2021-10-16 02:56:07 +0300 |
commit | 027d052a36e56789a2134772bacb4fd0860f03a3 (patch) | |
tree | f2e5ac181302c166fdee0569a53b917c658e9f73 /drivers/gpu/drm/msm | |
parent | 7425e8167507fe512d8ac0825acda4aebf0a7ca0 (diff) | |
download | linux-027d052a36e56789a2134772bacb4fd0860f03a3.tar.xz |
drm/msm: fix potential NULL dereference in cleanup
The "msm_obj->node" list needs to be initialized earlier so that the
list_del() in msm_gem_free_object() doesn't experience a NULL pointer
dereference.
Fixes: 6ed0897cd800 ("drm/msm: Fix debugfs deadlock")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20211013081133.GF6010@kili
Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/msm')
-rw-r--r-- | drivers/gpu/drm/msm/msm_gem.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c index 22308a1b66fc..fd398a4eaf46 100644 --- a/drivers/gpu/drm/msm/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c @@ -1132,6 +1132,7 @@ static int msm_gem_new_impl(struct drm_device *dev, msm_obj->flags = flags; msm_obj->madv = MSM_MADV_WILLNEED; + INIT_LIST_HEAD(&msm_obj->node); INIT_LIST_HEAD(&msm_obj->vmas); *obj = &msm_obj->base; |