Blob Blame History Raw
From 32d174d2d5eb318c34ff36771adefabdf227c186 Mon Sep 17 00:00:00 2001
From: Tang Bin <tangbin@cmss.chinamobile.com>
Date: Mon, 26 Oct 2020 17:06:57 +0800
Subject: [PATCH] usb: host: ehci-tegra: Fix error handling in
 tegra_ehci_probe()
Git-commit: 32d174d2d5eb318c34ff36771adefabdf227c186
References: git-fixes
Patch-mainline: v5.10-rc2

If the function platform_get_irq() failed, the negative value
returned will not be detected here. So fix error handling in
tegra_ehci_probe().

Fixes: 79ad3b5add4a ("usb: host: Add EHCI driver for NVIDIA Tegra SoCs")
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20201026090657.49988-1-tangbin@cmss.chinamobile.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/usb/host/ehci-tegra.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -508,9 +508,9 @@ static int tegra_ehci_probe(struct platf
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (!irq) {
+	if (irq < 0) {
 		dev_err(&pdev->dev, "Failed to get IRQ\n");
-		err = -ENODEV;
+		err = irq;
 		goto cleanup_phy;
 	}