diff mbox series

[12/22] usb: host: ohci-omap: deny IRQ0

Message ID 20211018183930.8448-13-s.shtylyov@omp.ru (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Sergey Shtylyov Oct. 18, 2021, 6:39 p.m. UTC
If platform_get_irq() returns IRQ0 (considered invalid according to Linus)
the driver blithely passes it to usb_add_hcd() that treats IRQ0 as no IRQ
at all. Deny IRQ0 right away, returning -EINVAL from the probe() method...

Fixes: 489447380a29 ("[PATCH] handle errors returned by platform_get_irq*()")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
 drivers/usb/host/ohci-omap.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index ded9738392e4..6d5f964d0995 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -309,6 +309,10 @@  static int ohci_hcd_omap_probe(struct platform_device *pdev)
 		retval = -ENXIO;
 		goto err3;
 	}
+	if (!irq) {
+		retval = -EINVAL;
+		goto err3;
+	}
 	retval = usb_add_hcd(hcd, irq, 0);
 	if (retval)
 		goto err3;