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: 6ed0897cd8 ("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>
This commit is contained in:
Dan Carpenter 2021-10-13 11:11:33 +03:00 коммит произвёл Rob Clark
Родитель 7425e81675
Коммит 027d052a36
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -1132,6 +1132,7 @@ static int msm_gem_new_impl(struct drm_device *dev,
msm_obj->flags = flags; msm_obj->flags = flags;
msm_obj->madv = MSM_MADV_WILLNEED; msm_obj->madv = MSM_MADV_WILLNEED;
INIT_LIST_HEAD(&msm_obj->node);
INIT_LIST_HEAD(&msm_obj->vmas); INIT_LIST_HEAD(&msm_obj->vmas);
*obj = &msm_obj->base; *obj = &msm_obj->base;