diff mbox series

[v2,08/22] usb: host: ohci-at91: deny IRQ0

Message ID 20211026173943.6829-9-s.shtylyov@omp.ru (mailing list archive)
State New, archived
Headers show
Series Explicitly deny IRQ0 in the USB host drivers | expand

Commit Message

Sergey Shtylyov Oct. 26, 2021, 5: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: fb5f1834c322 ("usb: ohci-at91: fix irq and iomem resource retrieval")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
---
Changes in version 2:
- added Alan's ACK.

 drivers/usb/host/ohci-at91.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index a24aea3d2759..6a7276a730d1 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -181,6 +181,8 @@  static int usb_hcd_at91_probe(const struct hc_driver *driver,
 		dev_dbg(dev, "hcd probe: missing irq resource\n");
 		return irq;
 	}
+	if (!irq)
+		return -EINVAL;
 
 	hcd = usb_create_hcd(driver, dev, "at91");
 	if (!hcd)