OSDN Git Service

net: cxgb3: remove redundant null pointer check before kfree_skb
authorzhong jiang <zhongjiang@huawei.com>
Thu, 20 Sep 2018 09:37:42 +0000 (17:37 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Sep 2018 16:04:37 +0000 (09:04 -0700)
kfree_skb has taken the null pointer into account. hence it is safe
to remove the redundant null pointer check before kfree_skb.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c

index 50cd660..84604af 100644 (file)
@@ -1302,8 +1302,7 @@ void cxgb3_offload_deactivate(struct adapter *adapter)
        rcu_read_unlock();
        RCU_INIT_POINTER(tdev->l2opt, NULL);
        call_rcu(&d->rcu_head, clean_l2_data);
-       if (t->nofail_skb)
-               kfree_skb(t->nofail_skb);
+       kfree_skb(t->nofail_skb);
        kfree(t);
 }