Re: Linux v5.8-rc1, pci.c, __pci_enable_wake() bug in checking the ret/error value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

I'm no longer maintaining the kernel PCI code, so I am forwarding your bug
report to the linux-pci list.

				Martin

>  I was reading the pci.c code and I notice that there is a possible bug on
> Linux v5,8-rc1 (5.6, as well) in __pci_enable_wake function. Reading at
> line 2328:
> 
> error = platform_pci_set_wakeup(dev, true);
> if (ret)
> ret = error;
> if (!ret)
> dev->wakeup_prepared = true;
> 
>  the value of ret is set at the beginning of function to zero and not used
> previously. I think this is a possible bug and it would be fixed by the
> following:
> 
> error = platform_pci_set_wakeup(dev, true);
> if (error)
> ret = error;
> else
> dev->wakeup_prepared = true;
> 
>  The source code I was reading is made available by bootlin trough elixir
> web interface
> 
> https://elixir.bootlin.com/linux/v5.8-rc1/source/drivers/pci/pci.c#L2322
> 
>  I hope this help.
> 
>  Best regards,
> -- 
> Roberto A. Foglietta
> +39.349.33.30.697



[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