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 pstates

As kzalloc may fail and return NULL pointer,
it should be better to check pstates
in order to avoid the NULL pointer dereference.

Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/514160/
Link: https://lore.kernel.org/r/20221206080236.43687-1-jiasheng@iscas.ac.cn
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

authored by

Jiasheng Jiang and committed by
Dmitry Baryshkov
93340e10 c96988b7

+2
+2
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
··· 1153 1153 bool needs_dirtyfb = dpu_crtc_needs_dirtyfb(crtc_state); 1154 1154 1155 1155 pstates = kzalloc(sizeof(*pstates) * DPU_STAGE_MAX * 4, GFP_KERNEL); 1156 + if (!pstates) 1157 + return -ENOMEM; 1156 1158 1157 1159 if (!crtc_state->enable || !crtc_state->active) { 1158 1160 DRM_DEBUG_ATOMIC("crtc%d -> enable %d, active %d, skip atomic_check\n",