]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: faraday: Fix of_irq_get() error check
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Sat, 15 Jul 2017 21:43:10 +0000 (00:43 +0300)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 16 Aug 2017 16:42:28 +0000 (11:42 -0500)
commit94304fa695b0a3c8eeda5bc717e21d6a02d42514
treec430d2199dc469413c229cd8228e2cdf1d6d8629
parent5a123201782b650425c83a3db7fd4eda87244f3f
PCI: faraday: Fix of_irq_get() error check

of_irq_get() may return a negative error number as well as 0 on failure,
while the driver only checks for 0, blithely continuing with the call to
irq_set_chained_handler_and_data() -- that function expects *unsigned int*
so should probably do nothing when a large IRQ number resulting from a
conversion of a negative error number is passed to it. The driver then
probes successfully while being only partly functional...

Check for 'irq <= 0' instead and propagate the negative error number to the
probe method --  that will allow the deferred probing as well.

Fixes: c13af0469b61 ("PCI: faraday: Add Faraday Technology FTPCI100 PCI Host Bridge driver")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pci/host/pci-ftpci100.c