drm/msm/dpu: reorder pointer operations after sanity checks to avoid NULL deref

_dpu_encoder_trigger_start dereferences "struct dpu_encoder_phys *phys"
before the sanity checks which can lead to a NULL pointer dereference if
phys is NULL.

Fix this by reordering the dereference after the sanity checks.

Fixes: 8144d17a81d9 ("drm/msm/dpu: Skip trigger flush and start for CWB")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Qasim Ijaz <qasdev00@gmail.com>
Reviewed-by: Jessica Zhang <quic_jesszhan@quicinc.com>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/647536/
Link: https://lore.kernel.org/r/20250408172223.10827-1-qasdev00@gmail.com
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>

authored by Qasim Ijaz and committed by Abhinav Kumar 2a34496f 5cb1b130

+3 -1
+3 -1
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
··· 1666 */ 1667 static void _dpu_encoder_trigger_start(struct dpu_encoder_phys *phys) 1668 { 1669 - struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(phys->parent); 1670 1671 if (!phys) { 1672 DPU_ERROR("invalid argument(s)\n"); ··· 1677 DPU_ERROR("invalid pingpong hw\n"); 1678 return; 1679 } 1680 1681 if (phys->parent->encoder_type == DRM_MODE_ENCODER_VIRTUAL && 1682 dpu_enc->cwb_mask) {
··· 1666 */ 1667 static void _dpu_encoder_trigger_start(struct dpu_encoder_phys *phys) 1668 { 1669 + struct dpu_encoder_virt *dpu_enc; 1670 1671 if (!phys) { 1672 DPU_ERROR("invalid argument(s)\n"); ··· 1677 DPU_ERROR("invalid pingpong hw\n"); 1678 return; 1679 } 1680 + 1681 + dpu_enc = to_dpu_encoder_virt(phys->parent); 1682 1683 if (phys->parent->encoder_type == DRM_MODE_ENCODER_VIRTUAL && 1684 dpu_enc->cwb_mask) {