linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: zhong jiang <zhongjiang@huawei.com>
To: <davem@davemloft.net>
Cc: <kuznet@ms2.inr.ac.ru>, <yoshfuji@linux-ipv6.org>,
	<santosh@chelsio.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH 3/6] ipv4: remove redundant null pointer check before kfree_skb
Date: Thu, 20 Sep 2018 17:37:43 +0800	[thread overview]
Message-ID: <1537436266-41955-4-git-send-email-zhongjiang@huawei.com> (raw)
In-Reply-To: <1537436266-41955-1-git-send-email-zhongjiang@huawei.com>

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>
---
 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


  parent reply	other threads:[~2018-09-20  9:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20  9:37 [PATCH 0/6] net: remove redundant null pointer check before kfree_skb zhong jiang
2018-09-20  9:37 ` [PATCH 1/6] net: tap: " zhong jiang
2018-09-20  9:37 ` [PATCH 2/6] net: cxgb3: " zhong jiang
2018-09-20  9:37 ` zhong jiang [this message]
2018-09-20  9:37 ` [PATCH 4/6] net: nci: " zhong jiang
2018-09-20  9:37 ` [PATCH 5/6] net: cxgb3_main: " zhong jiang
2018-09-20  9:37 ` [PATCH 6/6] ipv6: " zhong jiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1537436266-41955-4-git-send-email-zhongjiang@huawei.com \
    --to=zhongjiang@huawei.com \
    --cc=davem@davemloft.net \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=santosh@chelsio.com \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).