From mboxrd@z Thu Jan 1 00:00:00 1970 From: zhong jiang Subject: [PATCH 3/6] ipv4: remove redundant null pointer check before kfree_skb Date: Thu, 20 Sep 2018 17:37:43 +0800 Message-ID: <1537436266-41955-4-git-send-email-zhongjiang@huawei.com> References: <1537436266-41955-1-git-send-email-zhongjiang@huawei.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , , , , To: Return-path: In-Reply-To: <1537436266-41955-1-git-send-email-zhongjiang@huawei.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org 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 --- net/ipv4/ip_fragment.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index da930b0..13f4d18 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c @@ -260,8 +260,7 @@ static void ip_expire(struct timer_list *t) spin_unlock(&qp->q.lock); out_rcu_unlock: rcu_read_unlock(); - if (head) - kfree_skb(head); + kfree_skb(head); ipq_put(qp); } -- 1.7.12.4