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/mdp5: Add check for kzalloc

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

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: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/514154/
Link: https://lore.kernel.org/r/20221206074819.18134-1-jiasheng@iscas.ac.cn
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

authored by

Jiasheng Jiang and committed by
Dmitry Baryshkov
13fcfcb2 93340e10

+4 -1
+4 -1
drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
··· 1139 1139 if (crtc->state) 1140 1140 mdp5_crtc_destroy_state(crtc, crtc->state); 1141 1141 1142 - __drm_atomic_helper_crtc_reset(crtc, &mdp5_cstate->base); 1142 + if (mdp5_cstate) 1143 + __drm_atomic_helper_crtc_reset(crtc, &mdp5_cstate->base); 1144 + else 1145 + __drm_atomic_helper_crtc_reset(crtc, NULL); 1143 1146 } 1144 1147 1145 1148 static const struct drm_crtc_funcs mdp5_crtc_no_lm_cursor_funcs = {