Skip to content

Commit

Permalink
drm/msm: fix NULL-deref on snapshot tear down
Browse files Browse the repository at this point in the history
commit a465353 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: 9865948 ("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>
  • Loading branch information
jhovold authored and gregkh committed May 17, 2023
1 parent 5b6b81d commit 16e0e6f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/msm/msm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,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);

Expand Down

0 comments on commit 16e0e6f

Please sign in to comment.