Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp437858pxx; Mon, 26 Oct 2020 11:55:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1Jt20JRZnYqNRzjO/0f++qLLVOU1jNJF83n/sr8Q0WfrJd51wYlFd4IHIeLsQX3VdDeUT X-Received: by 2002:a17:906:824b:: with SMTP id f11mr16613980ejx.16.1603738509856; Mon, 26 Oct 2020 11:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603738509; cv=none; d=google.com; s=arc-20160816; b=G3AhtsU8JGHI1Xu7+4Djk8KFc1lbkN8OAoJRxwQttdpDCCV2r24Ct4J02pZj81Kdli FU5DsIa5qZMtflxAGpKBHVQgWSOS/jgfmgnURfZrcRU/BU9kZHo8ZvRQTJDeYJ4mGHux D4XL6SQBXdBbMKgmuWPrCnDSEq0Xj7ryLM4tUCBLAVuZh4+OB0Q23BPoUnGJeZUyBGDI Mu2Ro4B/8B1N9O/k3sbvmPWgr5asEJ3AzKPkQxOr1Dp3Tn5gjqezj3aRjd+ZJ3wjjLu6 cM5xdFnWDVO4/dDPxTPUfVnLN8zHRHVehLCfspYQHeLzysy5hRZojWNllIC7l4sehVXR 7gCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=xsTUAxGQZcWSJfTd2o6tLK68GhLIahVjGuT8yOHxVzM=; b=SoNsWpus2cgKAtZ7E/106RbhBW/ZZ2MC0QlYqPwUsiKWrYRzPkEvK/ka8DLEz2SM/o foOdXWODthM2oTM2rWyIt3lbax2EUTrTHga/k1zuI6i4qjL4mZGZ9hfFmNih1DnDUjnp Oakw8ZBII2G6rtc9oEnZERLmUQP0LNdesd7xdAIprR2M1SSa54O5QfIvCwen31mzMtCw 4E+DQIH10XmElTrgFF/fP7gw8/WbxYQPTzsjkm3gY78kC0LPg3bsIgEYQHqUy84/sN0S i2Uhht68NS6kNeHkQoomIgeQl2OJRVc5bUrFSpGVccN/Eqg7Mvz+DKiSk0mqkScct/+i J7dA== 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 m17si7463249edf.309.2020.10.26.11.54.47; Mon, 26 Oct 2020 11:55:09 -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 S1783069AbgJZPFk (ORCPT + 99 others); Mon, 26 Oct 2020 11:05:40 -0400 Received: from netrider.rowland.org ([192.131.102.5]:60867 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1783063AbgJZPFj (ORCPT ); Mon, 26 Oct 2020 11:05:39 -0400 Received: (qmail 1193324 invoked by uid 1000); 26 Oct 2020 11:05:38 -0400 Date: Mon, 26 Oct 2020 11:05:38 -0400 From: Alan Stern To: Tang Bin Cc: gregkh@linuxfoundation.org, thierry.reding@gmail.com, jonathanh@nvidia.com, linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: host: ehci-tegra: Fix error handling in tegra_ehci_probe() Message-ID: <20201026150538.GA1192191@rowland.harvard.edu> References: <20201026090657.49988-1-tangbin@cmss.chinamobile.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201026090657.49988-1-tangbin@cmss.chinamobile.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 26, 2020 at 05:06:57PM +0800, Tang Bin wrote: > 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); Acked-by: Alan Stern The "if (!irq)" statement occurs at least one other driver in this directory. Would you like to submit a patch for ehci-xilinx-of.c as well? Alan Stern