drm/msm/dpu: Fix smatch warnings about variable dereferenced before check
PATCH v2 1/1 drm/msm/dpu: Fix smatch warnings about variable dereferenced before check
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)
---
v2: Fix error code
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp_v13.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp_v13.c +3 -1
@@ -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++) {
Signature · 1 line
2.25.1
Quoted 6 lines · On Fri, Jan 30, 2026 at 01:36:15PM +0800, [email protected] wrote:
From: sunliming <[email protected]>
Fix below smatch warnings:
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp_v13.c:161dpu_hw_sspp_setup_pe_config_v13()
warn: variable dereferenced before check 'ctx' (see line 159)
Quoted 6 lines
Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Signed-off-by sunliming <[email protected]>---
v2: Fix error code
Which error code?
Quoted 26 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp_v13.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp_v13.c +3
-1@@ -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++) {Signature · 1 line
2.25.1
Signature · 2 lines
With best wishes Dmitry
Quoted 10 lines · On Fri, Jan 30, 2026 at 01:36:15PM +0800, [email protected] wrote:
From: sunliming <[email protected]>
Fix below smatch warnings:
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp_v13.c:161dpu_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]>Signed-off-by sunliming <[email protected]>
Quoted 6 lines
---
v2: Fix error codedrivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp_v13.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Signature · 2 lines
With best wishes Dmitry
Dmitry Baryshkov
AppliedQuoted 5 lines · On Fri, 30 Jan 2026 13:36:15 +0800, [email protected] wrote:
Fix below smatch warnings:
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp_v13.c:161dpu_hw_sspp_setup_pe_config_v13()
warn: variable dereferenced before check 'ctx' (see line 159)
Applied to msm-fixes, thanks!
[1/1] drm/msm/dpu: Fix smatch warnings about variable dereferenced before check
https://gitlab.freedesktop.org/lumag/msm/-/commit/b1dcc804f466
Best regards,
Signature · 2 lines
With best wishes Dmitry