Thread (41 messages) 41 messages, 8 authors, 2021-10-27
STALE1680d
Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH 09/22] usb: host: ohci-da8xx: deny IRQ0

From: Sergey Shtylyov <hidden>
Date: 2021-10-18 18:39:47
Subsystem: 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: efe7daf2231a ("USB: OHCI: DA8xx/OMAP-L1x glue layer")
Signed-off-by: Sergey Shtylyov <redacted>
---
 drivers/usb/host/ohci-da8xx.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c
index 1371b0c249ec..6d08ab2bf163 100644
--- a/drivers/usb/host/ohci-da8xx.c
+++ b/drivers/usb/host/ohci-da8xx.c
@@ -449,6 +449,10 @@ static int ohci_da8xx_probe(struct platform_device *pdev)
 		error = -ENODEV;
 		goto err;
 	}
+	if (!hcd_irq) {
+		error = -EINVAL;
+		goto err;
+	}
 
 	error = usb_add_hcd(hcd, hcd_irq, 0);
 	if (error)
-- 
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