From: sunliming <[email protected]>

Fix below smatch warnings:
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp_v13.c:161 
dpu_hw_sspp_setup_pe_config_v13()
warn: variable dereferenced before check 'ctx' (see line 159)

Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Closes: https://lore.kernel.org/r/[email protected]/
Signed-off-by: sunliming <[email protected]>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp_v13.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp_v13.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp_v13.c
index e65f1fc026fd..312ee6597ab1 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp_v13.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp_v13.c
@@ -156,11 +156,13 @@ static void dpu_hw_sspp_setup_pe_config_v13(struct 
dpu_hw_sspp *ctx,
        u8 color;
        u32 lr_pe[4], tb_pe[4];
        const u32 bytemask = 0xff;
-       u32 offset = ctx->cap->sblk->sspp_rec0_blk.base;
+       u32 offset;
 
        if (!ctx || !pe_ext)
                return;
 
+       offset = ctx->cap->sblk->sspp_rec0_blk.base;
+
        c = &ctx->hw;
        /* program SW pixel extension override for all pipes*/
        for (color = 0; color < DPU_MAX_PLANES; color++) {
-- 
2.25.1

Reply via email to