linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: host: ehci-tegra: Fix error handling in tegra_ehci_probe()
@ 2020-10-26  9:06 Tang Bin
  2020-10-26 15:05 ` Alan Stern
  2020-10-27 13:03 ` [PATCH] usb: host: ehci-tegra: Fix error handling in tegra_ehci_probe() Thierry Reding
  0 siblings, 2 replies; 4+ messages in thread
From: Tang Bin @ 2020-10-26  9:06 UTC (permalink / raw)
  To: stern, gregkh, thierry.reding, jonathanh
  Cc: linux-usb, linux-tegra, linux-kernel, Tang Bin

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 <tangbin@cmss.chinamobile.com>
---
 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




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: host: ehci-tegra: Fix error handling in tegra_ehci_probe()
  2020-10-26  9:06 [PATCH] usb: host: ehci-tegra: Fix error handling in tegra_ehci_probe() Tang Bin
@ 2020-10-26 15:05 ` Alan Stern
  2020-10-27  1:12   ` [PATCH] usb: host: ehci-tegra: Fix error handling integra_ehci_probe() Tang Bin
  2020-10-27 13:03 ` [PATCH] usb: host: ehci-tegra: Fix error handling in tegra_ehci_probe() Thierry Reding
  1 sibling, 1 reply; 4+ messages in thread
From: Alan Stern @ 2020-10-26 15:05 UTC (permalink / raw)
  To: Tang Bin
  Cc: gregkh, thierry.reding, jonathanh, linux-usb, linux-tegra, linux-kernel

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 <tangbin@cmss.chinamobile.com>
> ---
>  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 <stern@rowland.harvard.edu>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: host: ehci-tegra: Fix error handling integra_ehci_probe()
  2020-10-26 15:05 ` Alan Stern
@ 2020-10-27  1:12   ` Tang Bin
  0 siblings, 0 replies; 4+ messages in thread
From: Tang Bin @ 2020-10-27  1:12 UTC (permalink / raw)
  To: Alan Stern
  Cc: gregkh, thierry.reding, jonathanh, linux-usb, linux-tegra, linux-kernel

在 2020/10/26 23:05, Alan Stern 写道:
> 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 <tangbin@cmss.chinamobile.com>
>> ---
>>   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 <stern@rowland.harvard.edu>
>
> 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?

OK, I will check this file out. Thanks!

Tang Bin




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: host: ehci-tegra: Fix error handling in tegra_ehci_probe()
  2020-10-26  9:06 [PATCH] usb: host: ehci-tegra: Fix error handling in tegra_ehci_probe() Tang Bin
  2020-10-26 15:05 ` Alan Stern
@ 2020-10-27 13:03 ` Thierry Reding
  1 sibling, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2020-10-27 13:03 UTC (permalink / raw)
  To: Tang Bin; +Cc: stern, gregkh, jonathanh, linux-usb, linux-tegra, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1042 bytes --]

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 <tangbin@cmss.chinamobile.com>
> ---
>  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: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-27 13:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26  9:06 [PATCH] usb: host: ehci-tegra: Fix error handling in tegra_ehci_probe() Tang Bin
2020-10-26 15:05 ` Alan Stern
2020-10-27  1:12   ` [PATCH] usb: host: ehci-tegra: Fix error handling integra_ehci_probe() Tang Bin
2020-10-27 13:03 ` [PATCH] usb: host: ehci-tegra: Fix error handling in tegra_ehci_probe() Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).