Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/msm/dpu: Add check for cstate

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: 1cff7440a86e ("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>

authored by

Jiasheng Jiang and committed by
Dmitry Baryshkov
c96988b7 6c021d77

+4 -1
+4 -1
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
··· 968 968 if (crtc->state) 969 969 dpu_crtc_destroy_state(crtc, crtc->state); 970 970 971 - __drm_atomic_helper_crtc_reset(crtc, &cstate->base); 971 + if (cstate) 972 + __drm_atomic_helper_crtc_reset(crtc, &cstate->base); 973 + else 974 + __drm_atomic_helper_crtc_reset(crtc, NULL); 972 975 } 973 976 974 977 /**