Blob Blame History Raw
From: zhong jiang <zhongjiang@huawei.com>
Date: Thu, 20 Sep 2018 17:37:43 +0800
Subject: ipv4: remove redundant null pointer check before kfree_skb
Patch-mainline: v4.20-rc1
Git-commit: 1d08962ff1e65e29019e5df07188413a85769a9d
References: CVE-2018-5391 bsc#1103097

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>
Acked-by: Michal Kubecek <mkubecek@suse.cz>

---
 net/ipv4/ip_fragment.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -258,8 +258,7 @@ static void ip_expire(unsigned long arg)
 	spin_unlock(&qp->q.lock);
 out_rcu_unlock:
 	rcu_read_unlock();
-	if (head)
-		kfree_skb(head);
+	kfree_skb(head);
 	ipq_put(qp);
 }