Skip to contentSkip to conversation

e1000e/ethtool.c: fix error checks

PATCH In review Adrian Bunk 2 participants 2 messages Oct 14, 2007 – Oct 15, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e1000e/ethtool.c: fix error checks

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

Spotted by the Coverity checker.

---

drivers/net/e1000e/ethtool.c +2 -2
@@ -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);
#1 lore raw
Quoted 13 lines · Adrian Bunk

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

Spotted by the Coverity checker.

---

drivers/net/e1000e/ethtool.c +0 -0
@@ -1451,11 +1451,11 @@ static int e1000_loopback_test(struct e1000_adapter *adapter, u64 *data)
 	}
 
 	*data = e1000_setup_desc_rings(adapter);

drivers/net/e1000e/ethtool.c static int e1000_loopback_test(struct e1000_adapter *adapter, u64 *data) · line 1461

Quoted 10 lines
drivers/net/e1000e/ethtool.c +2 -2
-	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