netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [2.6 patch] e1000e/ethtool.c: fix error checks
@ 2007-10-14 17:51 Adrian Bunk
  2007-10-15 16:20 ` Kok, Auke
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian Bunk @ 2007-10-14 17:51 UTC (permalink / raw)
  To: Auke Kok, Jeff Garzik; +Cc: e1000-devel, netdev, linux-kernel

You want to check for the value, not for the address.

Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -1451,11 +1451,11 @@ static int e1000_loopback_test(struct e1000_adapter *adapter, u64 *data)
 	}
 
 	*data = e1000_setup_desc_rings(adapter);
-	if (data)
+	if (*data)
 		goto out;
 
 	*data = e1000_setup_loopback_test(adapter);
-	if (data)
+	if (*data)
 		goto err_loopback;
 
 	*data = e1000_run_loopback_test(adapter);

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

* Re: [2.6 patch] e1000e/ethtool.c: fix error checks
  2007-10-14 17:51 [2.6 patch] e1000e/ethtool.c: fix error checks Adrian Bunk
@ 2007-10-15 16:20 ` Kok, Auke
  0 siblings, 0 replies; 2+ messages in thread
From: Kok, Auke @ 2007-10-15 16:20 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Auke Kok, Jeff Garzik, e1000-devel, netdev, linux-kernel

Adrian Bunk wrote:
> You want to check for the value, not for the address.
> 
> Spotted by the Coverity checker.
> 
> Signed-off-by: Adrian Bunk <bunk@kernel.org>
> 
> ---
> --- a/drivers/net/e1000e/ethtool.c
> +++ b/drivers/net/e1000e/ethtool.c
> @@ -1451,11 +1451,11 @@ static int e1000_loopback_test(struct e1000_adapter *adapter, u64 *data)
>  	}
>  
>  	*data = e1000_setup_desc_rings(adapter);
> -	if (data)
> +	if (*data)
>  		goto out;
>  
>  	*data = e1000_setup_loopback_test(adapter);
> -	if (data)
> +	if (*data)
>  		goto err_loopback;
>  
>  	*data = e1000_run_loopback_test(adapter);

I'll forward this to Jeff,

thanks.

Auke

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

end of thread, other threads:[~2007-10-15 16:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-14 17:51 [2.6 patch] e1000e/ethtool.c: fix error checks Adrian Bunk
2007-10-15 16:20 ` Kok, Auke

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).