mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
drm/msm/dpu: Add check for cstate
[ Upstream commitc96988b7d9] As kzalloc may fail and return NULL pointer, it should be better to check cstate in order to avoid the NULL pointer dereference in __drm_atomic_helper_crtc_reset. Fixes:1cff7440a8("drm/msm: Convert to using __drm_atomic_helper_crtc_reset() for reset.") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/514163/ Link: https://lore.kernel.org/r/20221206080517.43786-1-jiasheng@iscas.ac.cn Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
70bc4db1fb
commit
31f2f8de0e
@@ -682,7 +682,10 @@ static void dpu_crtc_reset(struct drm_crtc *crtc)
|
|||||||
if (crtc->state)
|
if (crtc->state)
|
||||||
dpu_crtc_destroy_state(crtc, crtc->state);
|
dpu_crtc_destroy_state(crtc, crtc->state);
|
||||||
|
|
||||||
__drm_atomic_helper_crtc_reset(crtc, &cstate->base);
|
if (cstate)
|
||||||
|
__drm_atomic_helper_crtc_reset(crtc, &cstate->base);
|
||||||
|
else
|
||||||
|
__drm_atomic_helper_crtc_reset(crtc, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user