drm/msm: fix NULL-deref on snapshot tear down
commit a465353b9250802f87b97123e33a17f51277f0b1 upstream.
In case of early initialisation errors and on platforms that do not use
the DPU controller, the deinitilisation code can be called with the kms
pointer set to NULL.
Fixes: 98659487b8 ("drm/msm: add support to take dpu snapshot")
Cc: stable@vger.kernel.org # 5.14
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/525099/
Link: https://lore.kernel.org/r/20230306100722.28485-4-johan+linaro@kernel.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
74543041c0
commit
8f0e1ad532
@@ -359,7 +359,8 @@ static int msm_drm_uninit(struct device *dev)
|
||||
msm_fbdev_free(ddev);
|
||||
#endif
|
||||
|
||||
msm_disp_snapshot_destroy(ddev);
|
||||
if (kms)
|
||||
msm_disp_snapshot_destroy(ddev);
|
||||
|
||||
drm_mode_config_cleanup(ddev);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user