Commit 8caad14e authored by Haowen Bai's avatar Haowen Bai Committed by Abhinav Kumar

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: default avatarHaowen Bai <baihaowen@meizu.com>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fixes: d7d0e73f ("drm/msm/dpu: introduce the dpu_encoder_phys_* for
Reviewed-by: default avatarAbhinav 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.comSigned-off-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
parent fb0af2da
......@@ -574,11 +574,11 @@ static void dpu_encoder_phys_wb_disable(struct dpu_encoder_phys *phys_enc)
*/
static void dpu_encoder_phys_wb_destroy(struct dpu_encoder_phys *phys_enc)
{
DPU_DEBUG("[wb:%d]\n", phys_enc->wb_idx - WB_0);
if (!phys_enc)
return;
DPU_DEBUG("[wb:%d]\n", phys_enc->wb_idx - WB_0);
kfree(phys_enc);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment