summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhong jiang <zhongjiang@huawei.com>2018-09-20 17:37:43 +0800
committerDavid S. Miller <davem@davemloft.net>2018-09-21 09:04:37 -0700
commit1d08962ff1e65e29019e5df07188413a85769a9d (patch)
treee4bf3bc4c21e5f68f3bf4a77581711ec7a0c217b
parent16a3f50f05985cbea468e043cd18394158eff820 (diff)
downloadlinux-1d08962ff1e65e29019e5df07188413a85769a9d.tar.gz
linux-1d08962ff1e65e29019e5df07188413a85769a9d.tar.bz2
linux-1d08962ff1e65e29019e5df07188413a85769a9d.zip
ipv4: remove redundant null pointer check before kfree_skb
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>
-rw-r--r--net/ipv4/ip_fragment.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index da930b01a147..13f4d189e12b 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -260,8 +260,7 @@ out:
spin_unlock(&qp->q.lock);
out_rcu_unlock:
rcu_read_unlock();
- if (head)
- kfree_skb(head);
+ kfree_skb(head);
ipq_put(qp);
}