mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Maxime Ripard <mripard@kernel.org>
Cc: sunliming@linux.dev, dave.stevenson@raspberrypi.com,
	mcanal@igalia.com, kernel-list@raspberrypi.com,
	maarten.lankhorst@linux.intel.com, tzimmermann@suse.de,
	airlied@gmail.com, simona@ffwll.ch,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	sunliming <sunliming@kylinos.cn>,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] drm/vc4: fix uninitialized smatch warnings
Date: Mon, 7 Apr 2025 11:56:13 +0300	[thread overview]
Message-ID: <e5e557bf-53b9-49ca-9bd7-3dfe85ccbbb8@stanley.mountain> (raw)
In-Reply-To: <20250407-colorful-important-saluki-5e4ac5@houat>

On Mon, Apr 07, 2025 at 09:13:59AM +0200, Maxime Ripard wrote:
> On Sat, Apr 05, 2025 at 10:45:03AM +0800, sunliming@linux.dev wrote:
> > From: sunliming <sunliming@kylinos.cn>
> > 
> > Fix below smatch warnings:
> > drivers/gpu/drm/vc4/vc4_gem.c:604 vc4_lock_bo_reservations() error: uninitialized symbol 'ret'.
> > 
> > Reported-by: kernel test robot <lkp@intel.com>
> > Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> > Closes: https://lore.kernel.org/r/202504021500.3AM1hKKS-lkp@intel.com/
> > Signed-off-by: sunliming <sunliming@kylinos.cn>
> > ---
> >  drivers/gpu/drm/vc4/vc4_gem.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c
> > index 8125f87edc60..04ea1696fc5d 100644
> > --- a/drivers/gpu/drm/vc4/vc4_gem.c
> > +++ b/drivers/gpu/drm/vc4/vc4_gem.c
> > @@ -582,7 +582,7 @@ static int
> >  vc4_lock_bo_reservations(struct vc4_exec_info *exec,
> >  			 struct drm_exec *exec_ctx)
> >  {
> > -	int ret;
> > +	int ret = 0;
> >  
> >  	/* Reserve space for our shared (read-only) fence references,
> >  	 * before we commit the CL to the hardware.
> 
> I don't see a code path where ret is used without being initialized. Can
> you clarify that in the commit log?

Apparently the drm_exec_until_all_locked() loop always iterates at least
once.  If you have the cross function database then this is parsed
automatically, but I've also hard coded it as a loop at least once macro
just a 1 minute ago to silence this false positive.s

regards,
dan carpenter



      reply	other threads:[~2025-04-07  8:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-05  2:45 sunliming
2025-04-07  7:13 ` Maxime Ripard
2025-04-07  8:56   ` Dan Carpenter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e5e557bf-53b9-49ca-9bd7-3dfe85ccbbb8@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=airlied@gmail.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-list@raspberrypi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mcanal@igalia.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=sunliming@kylinos.cn \
    --cc=sunliming@linux.dev \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®