From: Navid Emamdoost <navid.emamdoost@gmail.com>
To: Vishal Kulkarni <vishal@chelsio.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: emamd001@umn.edu, Navid Emamdoost <navid.emamdoost@gmail.com>
Subject: [PATCH v2] cxgb4: add missing release on skb in uld_send()
Date: Wed, 22 Jul 2020 13:57:21 -0500 [thread overview]
Message-ID: <20200722185722.3580-1-navid.emamdoost@gmail.com> (raw)
In-Reply-To: <20200720.183113.2100585349998522874.davem@davemloft.net>
In the implementation of uld_send(), the skb is consumed on all
execution paths except one. Release skb when returning NET_XMIT_DROP.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
changes in v2:
- using kfree_skb() based on David Miller suggestion.
---
drivers/net/ethernet/chelsio/cxgb4/sge.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c
index d8c37fd4b808..92eee66cbc84 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
@@ -2938,7 +2938,7 @@ static inline int uld_send(struct adapter *adap, struct sk_buff *skb,
txq_info = adap->sge.uld_txq_info[tx_uld_type];
if (unlikely(!txq_info)) {
WARN_ON(true);
- consume_skb(skb);
+ kfree_skb(skb);
return NET_XMIT_DROP;
}
--
2.17.1
next prev parent reply other threads:[~2020-07-22 18:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-18 5:18 [PATCH] cxgb4: add missing release on skb in uld_send() Navid Emamdoost
2020-07-21 1:31 ` David Miller
2020-07-22 18:57 ` Navid Emamdoost [this message]
2020-07-23 1:14 ` [PATCH v2] " David Miller
2020-07-23 2:58 ` [PATCH v3] " Navid Emamdoost
2020-07-23 3:09 ` David Miller
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=20200722185722.3580-1-navid.emamdoost@gmail.com \
--to=navid.emamdoost@gmail.com \
--cc=davem@davemloft.net \
--cc=emamd001@umn.edu \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vishal@chelsio.com \
/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).