drm/msm: fix potential NULL dereference in cleanup
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 13 Oct 2021 08:11:33 +0000 (11:11 +0300)
committerRob Clark <robdclark@chromium.org>
Fri, 15 Oct 2021 23:56:07 +0000 (16:56 -0700)
commit027d052a36e56789a2134772bacb4fd0860f03a3
treef2e5ac181302c166fdee0569a53b917c658e9f73
parent7425e8167507fe512d8ac0825acda4aebf0a7ca0
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>
drivers/gpu/drm/msm/msm_gem.c