]> git.baikalelectronics.ru Git - kernel.git/commit
can: peak/pci: fix potential bug when probe() fails
authorStephane Grosjean <s.grosjean@peak-system.com>
Thu, 23 Nov 2017 14:44:35 +0000 (15:44 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 1 Dec 2017 10:20:52 +0000 (11:20 +0100)
commitaa8b3ab37e8fa0e104460c309951c09e283d365d
tree9bf6eba1d991a9e003e7dc9c9bc9faa97850c8e0
parentfac5f0be90a2eb52804fdbca6a0e745455589445
can: peak/pci: fix potential bug when probe() fails

PCI/PCIe drivers for PEAK-System CAN/CAN-FD interfaces do some access to the
PCI config during probing. In case one of these accesses fails, a POSITIVE
PCIBIOS_xxx error code is returned back. This POSITIVE error code MUST be
converted into a NEGATIVE errno for the probe() function to indicate it
failed. Using the pcibios_err_to_errno() function, we make sure that the
return code will always be negative.

Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/peak_canfd/peak_pciefd_main.c
drivers/net/can/sja1000/peak_pci.c