]> git.baikalelectronics.ru Git - kernel.git/commit
usb: host: ohci-tmio: add IRQ check
authorSergey Shtylyov <s.shtylyov@omp.ru>
Fri, 13 Aug 2021 20:30:18 +0000 (23:30 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 07:47:35 +0000 (09:47 +0200)
commitd953456dc822bdd4c0f077de2ccb11e3183d408a
treebb145b1d30d93f5a579da0802929e5e1c876301c
parent397ad8d5996df88db102425d3a8ac12c4030de3c
usb: host: ohci-tmio: add IRQ check

[ Upstream commit 4ac5132e8a4300637a2da8f5d6bc7650db735b8a ]

The driver neglects to check the  result of platform_get_irq()'s call and
blithely passes the negative error codes to usb_add_hcd() (which takes
*unsigned* IRQ #), causing request_irq() that it calls to fail with
-EINVAL, overriding an original error code. Stop calling usb_add_hcd()
with the invalid IRQ #s.

Fixes: b8b96b8fefb4 ("USB: ohci: add support for tmio-ohci cell")
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/402e1a45-a0a4-0e08-566a-7ca1331506b1@omp.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/host/ohci-tmio.c