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 Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx/
> 
> 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).



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux