From: Dan Carpenter Date: Thu, 7 Jul 2016 08:23:09 +0000 (+0300) Subject: bnxt: fix a condition X-Git-Tag: v4.1.12-92~10^2~52 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=65c57fdd798872e83dfb75f940edccc5282af27d;p=users%2Fjedix%2Flinux-maple.git bnxt: fix a condition Orabug: 24567991 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.') Signed-off-by: Dan Carpenter Acked-by: Michael Chan Signed-off-by: David S. Miller (cherry picked from commit 09a7636a5b151670072de60767ddf096dc7bd12e) Signed-off-by: Brian Maly Signed-off-by: Dhaval Giani --- diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index ff13b7ed493fa..60e268cb8b8f7 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -1001,7 +1001,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) {