Skip to contentSkip to conversation

bnxt: fix a condition

PATCH Applied Dan Carpenter 3 participants 3 messages Jul 7, 2016 – Jul 9, 2016

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

PATCH 1/1 bnxt: fix a condition

This code generates as static checker warning because htons(ETH_P_IPV6) is always true. From the context it looks like the && was intended to be !=.

Fixes 94758f8de037 ('bnxt_en: Add GRO logic for BCM5731X chips.')
drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 -1
index 70b148a..659faa6 100644
@@ -997,7 +997,7 @@ static struct sk_buff *bnxt_gro_func_5731x(struct bnxt_tpa_info *tpa_info,
 		 * correct protocol ID, it must be a loopback packet where
 		 * the offsets are off by 4.
 		 */
-		if (proto != htons(ETH_P_IP) && proto && htons(ETH_P_IPV6))
+		if (proto != htons(ETH_P_IP) && proto != htons(ETH_P_IPV6))
 			loopback = true;
 	}
 	if (loopback) {
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dan Carpenter

This code generates as static checker warning because htons(ETH_P_IPV6) is always true. From the context it looks like the && was intended to be !=.

Fixes 94758f8de037 ('bnxt_en: Add GRO logic for BCM5731X chips.')

Thanks. The fix is correct.