Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp53369pxx; Mon, 26 Oct 2020 03:10:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYShUkP3ZPhJ5LoocohYlPqqFz/fJFtmM9/6IVI9+iN9+83hL0gAPTpqO1mZ1Idk2r4k3b X-Received: by 2002:a50:b904:: with SMTP id m4mr14439129ede.304.1603707043463; Mon, 26 Oct 2020 03:10:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603707043; cv=none; d=google.com; s=arc-20160816; b=jtWnFX6ihy2w3z6LVCmPlDiLckfcMMBHLIUwwrMmycFT+thWWuHGReqWoZcvP47t9O ayzhAYYDESAgco9HmaBF9JxdcSrvWc/wgTPfgnKh7qobucT1GZzV13+b75TO4gP1vceW f7tZ4DNgkFeI4RLEBcGEesHr/GkNBRzhAtwlwG8J8eSE2uxbwXIZ1kv0eA7WCWrnPA80 w74k9h13MnVFaSMX8ma0Dajz6sP1WsqYb3Wmjjvq3DmHO9x/h7y2zHhB/hTe9KswTFAq b5qo1pyd5xBNBWhJEd5le0W+S4wAKXzLAvftUUuPwoE7RZDhhCpEvRBEYj+WBRnDlnKy 8+Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=40y+UWTZDrAlV8/fgJu1EB+ouUxReet6kROW+gEPS+A=; b=erHzGaOkXm8sMyQl/fozuQxF0NmrYqUZ85r3oORsPkRqmOQOJhKL6cUWJPwdOp74wW T9KsbvgNkL0elxnbITNL9soEopo6thzUZI/2FqMjwTufzZU7wMUI2aYVZCiQSsEfDh+4 C3fDw16zgBuGxwKO/WTWhtiPJFwIEF+AsbdoCV+ZMYt/cz+r0uLChBGmXgKTXr55KyjD mHrgY5cXX+4JlaYONfleL90NRE7VnTyJdPmIoPTx9t/gsQsYkkzpJ6dBwV+ydF+WAO7o na2HwxmzlIN+Omnm+9T7Ugr9fowZKq7FNT6dViAbSb50NlicRj79HW3RbT8n1KRRyFzR xS4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c19si6895487ejp.465.2020.10.26.03.10.18; Mon, 26 Oct 2020 03:10:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1772566AbgJZJG7 (ORCPT + 99 others); Mon, 26 Oct 2020 05:06:59 -0400 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:63555 "EHLO cmccmta1.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391070AbgJZJG7 (ORCPT ); Mon, 26 Oct 2020 05:06:59 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.3]) by rmmx-syy-dmz-app03-12003 (RichMail) with SMTP id 2ee35f96919b00c-e1f43; Mon, 26 Oct 2020 17:06:35 +0800 (CST) X-RM-TRANSID: 2ee35f96919b00c-e1f43 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[223.112.105.130]) by rmsmtp-syy-appsvr02-12002 (RichMail) with SMTP id 2ee25f969198e03-26d43; Mon, 26 Oct 2020 17:06:35 +0800 (CST) X-RM-TRANSID: 2ee25f969198e03-26d43 From: Tang Bin To: stern@rowland.harvard.edu, gregkh@linuxfoundation.org, thierry.reding@gmail.com, jonathanh@nvidia.com Cc: linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, Tang Bin Subject: [PATCH] usb: host: ehci-tegra: Fix error handling in tegra_ehci_probe() Date: Mon, 26 Oct 2020 17:06:57 +0800 Message-Id: <20201026090657.49988-1-tangbin@cmss.chinamobile.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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") Signed-off-by: Tang Bin --- drivers/usb/host/ehci-tegra.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 75a075daf..7b0efaf15 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -479,9 +479,9 @@ 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; - goto cleanup_phy; + if (irq < 0) { + err = irq; + goto cleanup_phy; } otg_set_host(u_phy->otg, &hcd->self); -- 2.20.1.windows.1