diff options
author | Johan Hovold <[email protected]> | 2023-03-06 11:07:15 +0100 |
---|---|---|
committer | Dmitry Baryshkov <[email protected]> | 2023-04-06 20:29:39 +0300 |
commit | a465353b9250802f87b97123e33a17f51277f0b1 (patch) | |
tree | babeefd175beb9dc5d19c5a5eb1e9ed21b9d9851 | |
parent | 652eadfde81031c7b3d8b21bdbcfdd6eb217dec8 (diff) |
drm/msm: fix NULL-deref on snapshot tear down
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: 98659487b845 ("drm/msm: add support to take dpu snapshot")
Cc: [email protected] # 5.14
Cc: Abhinav Kumar <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/525099/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
-rw-r--r-- | drivers/gpu/drm/msm/msm_drv.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 3286ba78f89a..91d60608a19a 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -243,7 +243,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); |