diff options
author | Sergey Shtylyov <[email protected]> | 2021-08-13 23:30:18 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2021-08-16 18:57:18 +0200 |
commit | 4ac5132e8a4300637a2da8f5d6bc7650db735b8a (patch) | |
tree | d86fe333619d45452e46421428dcc7c76eddf2e6 | |
parent | 1a5f6cd286670238265b3c17ae0e8bd146828f40 (diff) |
usb: host: ohci-tmio: add IRQ check
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: 78c73414f4f6 ("USB: ohci: add support for tmio-ohci cell")
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Sergey Shtylyov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r-- | drivers/usb/host/ohci-tmio.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/host/ohci-tmio.c b/drivers/usb/host/ohci-tmio.c index 7f857bad9e95..08ec2ab0d95a 100644 --- a/drivers/usb/host/ohci-tmio.c +++ b/drivers/usb/host/ohci-tmio.c @@ -202,6 +202,9 @@ static int ohci_hcd_tmio_drv_probe(struct platform_device *dev) if (!cell) return -EINVAL; + if (irq < 0) + return irq; + hcd = usb_create_hcd(&ohci_tmio_hc_driver, &dev->dev, dev_name(&dev->dev)); if (!hcd) { ret = -ENOMEM; |