aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Shtylyov <[email protected]>2021-08-13 23:32:38 +0300
committerGreg Kroah-Hartman <[email protected]>2021-08-16 18:57:19 +0200
commit0d45a1373e669880b8beaecc8765f44cb0241e47 (patch)
treea42a794d1e820441bd93c091ae6e772600fb60e4
parent4ac5132e8a4300637a2da8f5d6bc7650db735b8a (diff)
usb: phy: tahvo: add IRQ check
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") Acked-by: Felipe Balbi <[email protected]> Signed-off-by: Sergey Shtylyov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/usb/phy/phy-tahvo.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/phy/phy-tahvo.c b/drivers/usb/phy/phy-tahvo.c
index baebb1f5a973..a3e043e3e4aa 100644
--- a/drivers/usb/phy/phy-tahvo.c
+++ b/drivers/usb/phy/phy-tahvo.c
@@ -393,7 +393,9 @@ static int tahvo_usb_probe(struct platform_device *pdev)
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);