On Wed, Jan 28, 2026 at 6:50 PM <[email protected]> wrote:
>
> 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;
> +
btw, in this case (and probably most/all such cases in dpu code that
I've looked at) we should probably just remove the impossible null
checks. (Although the extra indirections in the dpu code make it
harder to see that they are impossible..)
BR,
-R
> c = &ctx->hw;
> /* program SW pixel extension override for all pipes*/
> for (color = 0; color < DPU_MAX_PLANES; color++) {
> --
> 2.25.1
>