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

[PATCH v2 02/22] usb: host: ehci-mv: deny IRQ0

From: Sergey Shtylyov <hidden>
Date: 2021-10-26 17:39:51
Subsystem: the rest, usb ehci 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: a7f40c233a6b ("USB: EHCI: ehci-mv: fix less than zero comparison of an unsigned int")
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/ehci-mv.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
index 8fd27249ad25..f54ce1eeccf3 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -168,6 +168,10 @@ static int mv_ehci_probe(struct platform_device *pdev)
 	retval = platform_get_irq(pdev, 0);
 	if (retval < 0)
 		goto err_disable_clk;
+	if (!retval) {
+		retval = -EINVAL;
+		goto err_disable_clk;
+	}
 	hcd->irq = retval;
 
 	ehci = hcd_to_ehci(hcd);
-- 
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