public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] drm/msm/dpu: Fix smatch warnings about variable dereferenced before check
@ 2026-01-29  2:49 sunliming
  2026-01-29  7:07 ` Dan Carpenter
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: sunliming @ 2026-01-29  2:49 UTC (permalink / raw)
  To: robin.clark, lumag, airlied, simona
  Cc: sean, marijn.suijten, linux-arm-msm, dri-devel, freedreno,
	linux-kernel, sunliming, kernel test robot, Dan Carpenter

From: sunliming <sunliming@kylinos.cn>

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 <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202601252214.oEaY3UZM-lkp@intel.com/
Signed-off-by: sunliming <sunliming@kylinos.cn>
---
 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH RESEND] drm/msm/dpu: Fix smatch warnings about variable dereferenced before check
  2026-01-29  2:49 [PATCH RESEND] drm/msm/dpu: Fix smatch warnings about variable dereferenced before check sunliming
@ 2026-01-29  7:07 ` Dan Carpenter
       [not found]   ` <b62dc0de-b39c-7515-25d8-6e6817df3f17@linux.dev>
  2026-01-31  8:30 ` Dmitry Baryshkov
  2026-02-01 17:04 ` Rob Clark
  2 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2026-01-29  7:07 UTC (permalink / raw)
  To: sunliming
  Cc: robin.clark, lumag, airlied, simona, sean, marijn.suijten,
	linux-arm-msm, dri-devel, freedreno, linux-kernel, sunliming,
	kernel test robot, Dan Carpenter

On Thu, Jan 29, 2026 at 10:49:19AM +0800, sunliming@linux.dev wrote:
> From: sunliming <sunliming@kylinos.cn>
> 
> 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 <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Closes: https://lore.kernel.org/r/202601252214.oEaY3UZM-lkp@intel.com/
> Signed-off-by: sunliming <sunliming@kylinos.cn>
> ---

Could you capitalize your name?  It's supposed to be a bit formal like
signing a legal document.

This isn't a RESEND, it's a v2.  A RESEND means we accidentally ignored
your email so now you have to send the exact same email again.

https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH RESEND] drm/msm/dpu: Fix smatch warnings about variable dereferenced before check
       [not found]   ` <b62dc0de-b39c-7515-25d8-6e6817df3f17@linux.dev>
@ 2026-01-30  8:24     ` Dan Carpenter
  2026-01-31  8:29     ` Dmitry Baryshkov
  1 sibling, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2026-01-30  8:24 UTC (permalink / raw)
  To: sunliming
  Cc: robin.clark, lumag, airlied, simona, sean, marijn.suijten,
	linux-arm-msm, dri-devel, freedreno, linux-kernel, sunliming,
	kernel test robot, Dan Carpenter

On Fri, Jan 30, 2026 at 01:30:35PM +0800, sunliming wrote:
> 
> On 2026/1/29 15:07, Dan Carpenter wrote:
> > On Thu, Jan 29, 2026 at 10:49:19AM +0800,sunliming@linux.dev  wrote:
> > > From: sunliming<sunliming@kylinos.cn>
> > > 
> > > 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<lkp@intel.com>
> > > Reported-by: Dan Carpenter<error27@gmail.com>
> > > Closes:https://lore.kernel.org/r/202601252214.oEaY3UZM-lkp@intel.com/
> > > Signed-off-by: sunliming<sunliming@kylinos.cn>
> > > ---
> 
> Previously, a maintainer suggested that the name should match the email
> address,
> 

Yes.  But normally people change their email address instead of their
name.

> but community patches have consistently used the name "sunliming" since
> then.
> 

Consistency is less important than being correct...  It's just a weird
thing to say.  Are there other non-community patches with a different
name?  It's fine if that's your legal name and we have made exceptions
for people who aren't able to share their real name because of stalking
or whatever...

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH RESEND] drm/msm/dpu: Fix smatch warnings about variable dereferenced before check
       [not found]   ` <b62dc0de-b39c-7515-25d8-6e6817df3f17@linux.dev>
  2026-01-30  8:24     ` Dan Carpenter
@ 2026-01-31  8:29     ` Dmitry Baryshkov
  1 sibling, 0 replies; 6+ messages in thread
From: Dmitry Baryshkov @ 2026-01-31  8:29 UTC (permalink / raw)
  To: sunliming
  Cc: Dan Carpenter, robin.clark, lumag, airlied, simona, sean,
	marijn.suijten, linux-arm-msm, dri-devel, freedreno, linux-kernel,
	sunliming, kernel test robot, Dan Carpenter

On Fri, Jan 30, 2026 at 01:30:35PM +0800, sunliming wrote:
> 
> On 2026/1/29 15:07, Dan Carpenter wrote:
> > On Thu, Jan 29, 2026 at 10:49:19AM +0800,sunliming@linux.dev  wrote:
> > > From: sunliming<sunliming@kylinos.cn>
> > > 
> > > 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<lkp@intel.com>
> > > Reported-by: Dan Carpenter<error27@gmail.com>
> > > Closes:https://lore.kernel.org/r/202601252214.oEaY3UZM-lkp@intel.com/
> > > Signed-off-by: sunliming<sunliming@kylinos.cn>
> > > ---
> 
> Previously, a maintainer suggested that the name should match the email
> address,
> 
> but community patches have consistently used the name "sunliming" since
> then.

There are several possible options here, but I see that this one have
been already used to contribute patches, which are accepted. I'm fine
with accepting this SoB.

> 
> > > Could you capitalize your name?  It's supposed to be a bit formal like
> > > signing a legal document.
> > > 
> > > This isn't a RESEND, it's a v2.  A RESEND means we accidentally ignored
> > > your email so now you have to send the exact same email again.
> > > 
> > > https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/
> Get it. thanks.
> > > regards,
> > > dan carpenter
> > > 

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH RESEND] drm/msm/dpu: Fix smatch warnings about variable dereferenced before check
  2026-01-29  2:49 [PATCH RESEND] drm/msm/dpu: Fix smatch warnings about variable dereferenced before check sunliming
  2026-01-29  7:07 ` Dan Carpenter
@ 2026-01-31  8:30 ` Dmitry Baryshkov
  2026-02-01 17:04 ` Rob Clark
  2 siblings, 0 replies; 6+ messages in thread
From: Dmitry Baryshkov @ 2026-01-31  8:30 UTC (permalink / raw)
  To: sunliming
  Cc: robin.clark, lumag, airlied, simona, sean, marijn.suijten,
	linux-arm-msm, dri-devel, freedreno, linux-kernel, sunliming,
	kernel test robot, Dan Carpenter

On Thu, Jan 29, 2026 at 10:49:19AM +0800, sunliming@linux.dev wrote:
> From: sunliming <sunliming@kylinos.cn>
> 
> 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 <lkp@intel.com>

Closes? (you can just reply to this email with the Closes: line and the
URL for the LKP report).

> Reported-by: Dan Carpenter <error27@gmail.com>
> Closes: https://lore.kernel.org/r/202601252214.oEaY3UZM-lkp@intel.com/
> Signed-off-by: sunliming <sunliming@kylinos.cn>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp_v13.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH RESEND] drm/msm/dpu: Fix smatch warnings about variable dereferenced before check
  2026-01-29  2:49 [PATCH RESEND] drm/msm/dpu: Fix smatch warnings about variable dereferenced before check sunliming
  2026-01-29  7:07 ` Dan Carpenter
  2026-01-31  8:30 ` Dmitry Baryshkov
@ 2026-02-01 17:04 ` Rob Clark
  2 siblings, 0 replies; 6+ messages in thread
From: Rob Clark @ 2026-02-01 17:04 UTC (permalink / raw)
  To: sunliming
  Cc: lumag, airlied, simona, sean, marijn.suijten, linux-arm-msm,
	dri-devel, freedreno, linux-kernel, sunliming, kernel test robot,
	Dan Carpenter

On Wed, Jan 28, 2026 at 6:50 PM <sunliming@linux.dev> wrote:
>
> From: sunliming <sunliming@kylinos.cn>
>
> 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 <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Closes: https://lore.kernel.org/r/202601252214.oEaY3UZM-lkp@intel.com/
> Signed-off-by: sunliming <sunliming@kylinos.cn>
> ---
>  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
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-02-01 17:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-29  2:49 [PATCH RESEND] drm/msm/dpu: Fix smatch warnings about variable dereferenced before check sunliming
2026-01-29  7:07 ` Dan Carpenter
     [not found]   ` <b62dc0de-b39c-7515-25d8-6e6817df3f17@linux.dev>
2026-01-30  8:24     ` Dan Carpenter
2026-01-31  8:29     ` Dmitry Baryshkov
2026-01-31  8:30 ` Dmitry Baryshkov
2026-02-01 17:04 ` Rob Clark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox