drm/msm/dpu: Add check for cstate
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Tue, 6 Dec 2022 08:05:17 +0000 (16:05 +0800)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tue, 24 Jan 2023 08:24:07 +0000 (10:24 +0200)
commitc96988b7d99327bb08bd9efd29a203b22cd88ace
treefa32162ba5a064030f5d644b775cafc5d19aa497
parent6c021d77e788aa046845e9877753a7a1148b24b3
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>
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c