Thread (36 messages) 36 messages, 6 authors, 2021-11-13
STALE1667d REVIEWED: 5 (5M)
Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

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

From: Sergey Shtylyov <hidden>
Date: 2021-10-26 17:40:00
Also in: linux-omap
Subsystem: omap usb support, the rest, usb ohci driver, usb subsystem · Maintainers: Linus Torvalds, Alan Stern, Greg Kroah-Hartman

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 <redacted>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
---
Changes in version 2:
- added Alan's ACK.

 drivers/usb/host/ohci-omap.c | 4 ++++
 1 file changed, 4 insertions(+)
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;
-- 
2.26.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help