From: Tang Bin <tang...@cmss.chinamobile.com> [ Upstream commit 32d174d2d5eb318c34ff36771adefabdf227c186 ]
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 <st...@rowland.harvard.edu> Acked-by: Thierry Reding <tred...@nvidia.com> Signed-off-by: Tang Bin <tang...@cmss.chinamobile.com> Link: https://lore.kernel.org/r/20201026090657.49988-1-tang...@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org> Signed-off-by: Sasha Levin <sas...@kernel.org> --- drivers/usb/host/ehci-tegra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index e077b2ca53c51..869d9c4de5fcd 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -479,8 +479,8 @@ static int tegra_ehci_probe(struct platform_device *pdev) u_phy->otg->host = hcd_to_bus(hcd); irq = platform_get_irq(pdev, 0); - if (!irq) { - err = -ENODEV; + if (irq < 0) { + err = irq; goto cleanup_phy; } -- 2.27.0