[PATCH v3 2/2] usb: phy: tahvo: add IRQ check
From: Sergey Shtylyov <hidden>
Date: 2021-08-13 20:32:42
The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to request_threaded_irq() (which
takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an
original error code. Stop calling request_threaded_irq() with the invalid
IRQ #s.
Fixes: 9ba96ae5074c ("usb: omap1: Tahvo USB transceiver driver")
Signed-off-by: Sergey Shtylyov <redacted>
---
drivers/usb/phy/phy-tahvo.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: usb/drivers/usb/phy/phy-tahvo.c
===================================================================--- usb.orig/drivers/usb/phy/phy-tahvo.c
+++ usb/drivers/usb/phy/phy-tahvo.c@@ -393,7 +393,9 @@ static int tahvo_usb_probe(struct platfo dev_set_drvdata(&pdev->dev, tu); - tu->irq = platform_get_irq(pdev, 0); + tu->irq = ret = platform_get_irq(pdev, 0); + if (ret < 0) + return ret; ret = request_threaded_irq(tu->irq, NULL, tahvo_usb_vbus_interrupt, IRQF_ONESHOT, "tahvo-vbus", tu);