[PATCH v2 5/9] usb: host: ohci-tmio: add IRQ check
From: Sergey Shtylyov <hidden>
Date: 2021-08-09 20:42:02
From: Sergey Shtylyov <hidden>
Date: 2021-08-09 20:42:02
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")
Signed-off-by: Sergey Shtylyov <redacted>
---
drivers/usb/host/ohci-tmio.c | 2 ++
1 file changed, 2 insertions(+)
Index: usb/drivers/usb/host/ohci-tmio.c
===================================================================--- usb.orig/drivers/usb/host/ohci-tmio.c
+++ usb/drivers/usb/host/ohci-tmio.c@@ -242,6 +242,8 @@ static int ohci_hcd_tmio_drv_probe(struc if (ret < 0) goto err_enable; + if (irq < 0) + goto err_enable; ret = usb_add_hcd(hcd, irq, 0); if (ret) goto err_add_hcd;