From: Bjorn Helgaas <helgaas@kernel.org>
To: "Pali Rohár" <pali@kernel.org>
Cc: kernel test robot <lkp@intel.com>,
llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-pci@vger.kernel.org
Subject: Re: [helgaas-pci:pci/enumeration 3/3] drivers/pci/probe.c:909:6: warning: variable 'err' is used uninitialized whenever 'if' condition is true
Date: Tue, 8 Nov 2022 11:15:53 -0600 [thread overview]
Message-ID: <20221108171553.GA479740@bhelgaas> (raw)
In-Reply-To: <20221108170619.jmcfvcuggkwjfo7j@pali>
On Tue, Nov 08, 2022 at 06:06:19PM +0100, Pali Rohár wrote:
> On Tuesday 08 November 2022 07:08:16 Bjorn Helgaas wrote:
> > Why did the bot tell me the build was *SUCCESSFUL* even though this is
> > clearly a problem? Here's the "success" message:
> >
> > https://lore.kernel.org/all/636a47ad.UocsB2qjv%2FcFWvK2%25lkp@intel.com/
> >
> > On Tue, Nov 08, 2022 at 03:21:20PM +0800, kernel test robot wrote:
> >
> > > >> drivers/pci/probe.c:909:6: warning: variable 'err' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
> > > if (bus->domain_nr < 0)
> > > ^~~~~~~~~~~~~~~~~~
> >
> > I set "err = -EINVAL" here; let me know if you prefer something
> > different.
>
> Hello! I agree that there is missing err= assignment.
>
> Instead of -EINVAL you can use also bus->domain_nr as it is negative and
> would contained error code (from ida_alloc() call).
Good idea, I adopted that :)
next prev parent reply other threads:[~2022-11-08 17:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-08 7:21 [helgaas-pci:pci/enumeration 3/3] drivers/pci/probe.c:909:6: warning: variable 'err' is used uninitialized whenever 'if' condition is true kernel test robot
2022-11-08 13:08 ` Bjorn Helgaas
2022-11-08 17:06 ` Pali Rohár
2022-11-08 17:15 ` Bjorn Helgaas [this message]
2022-11-14 9:17 ` Chen, Rong A
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=20221108171553.GA479740@bhelgaas \
--to=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pali@kernel.org \
/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