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 2/6] net: cxgb3: remove redundant null pointer check before kfree_skb
Date: Thu, 20 Sep 2018 17:37:42 +0800 [thread overview]
Message-ID: <1537436266-41955-3-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>
---
drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
index 50cd660..84604af 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
@@ -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);
}
--
1.7.12.4
next prev 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 ` zhong jiang [this message]
2018-09-20 9:37 ` [PATCH 3/6] ipv4: " zhong jiang
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-3-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).