Skip to content

Commit 8caad14

Browse files
Lotte-BaiAbhinav Kumar
authored andcommitted
drm/msm/dpu: Fix pointer dereferenced before checking
The phys_enc->wb_idx is dereferencing before null checking, so move it after checking. Signed-off-by: Haowen Bai <baihaowen@meizu.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Fixes: d7d0e73 ("drm/msm/dpu: introduce the dpu_encoder_phys_* for Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com> Patchwork: https://patchwork.freedesktop.org/patch/487606/ Link: https://lore.kernel.org/r/1653877196-23114-1-git-send-email-baihaowen@meizu.com Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
1 parent fb0af2d commit 8caad14

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,11 +574,11 @@ static void dpu_encoder_phys_wb_disable(struct dpu_encoder_phys *phys_enc)
574574
*/
575575
static void dpu_encoder_phys_wb_destroy(struct dpu_encoder_phys *phys_enc)
576576
{
577-
DPU_DEBUG("[wb:%d]\n", phys_enc->wb_idx - WB_0);
578-
579577
if (!phys_enc)
580578
return;
581579

580+
DPU_DEBUG("[wb:%d]\n", phys_enc->wb_idx - WB_0);
581+
582582
kfree(phys_enc);
583583
}
584584

0 commit comments

Comments
 (0)