All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Navid Emamdoost <navid.emamdoost@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Sasha Levin <sashal@kernel.org>,
	netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 4.19 09/10] cxgb4: add missing release on skb in uld_send()
Date: Mon, 27 Jul 2020 19:24:42 -0400	[thread overview]
Message-ID: <20200727232443.718000-9-sashal@kernel.org> (raw)
In-Reply-To: <20200727232443.718000-1-sashal@kernel.org>

From: Navid Emamdoost <navid.emamdoost@gmail.com>

[ Upstream commit e6827d1abdc9b061a57d7b7d3019c4e99fabea2f ]

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/chelsio/cxgb4/sge.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c
index 3d4a765e9e61d..7801f2aeeb30e 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
@@ -2367,6 +2367,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);
+		kfree_skb(skb);
 		return NET_XMIT_DROP;
 	}
 
-- 
2.25.1


  parent reply	other threads:[~2020-07-27 23:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-27 23:24 [PATCH AUTOSEL 4.19 01/10] usb: hso: Fix debug compile warning on sparc32 Sasha Levin
2020-07-27 23:24 ` [PATCH AUTOSEL 4.19 02/10] qed: Disable "MFW indication via attention" SPAM every 5 minutes Sasha Levin
2020-07-27 23:24 ` [PATCH AUTOSEL 4.19 03/10] nfc: s3fwrn5: add missing release on skb in s3fwrn5_recv_frame Sasha Levin
2020-07-27 23:24 ` [PATCH AUTOSEL 4.19 04/10] parisc: add support for cmpxchg on u8 pointers Sasha Levin
2020-07-27 23:24 ` [PATCH AUTOSEL 4.19 05/10] net: ethernet: ravb: exit if re-initialization fails in tx timeout Sasha Levin
2020-07-27 23:24 ` [PATCH AUTOSEL 4.19 06/10] drivers/net/wan/x25_asy: Fix to make it work Sasha Levin
2020-07-27 23:24 ` [PATCH AUTOSEL 4.19 07/10] Revert "i2c: cadence: Fix the hold bit setting" Sasha Levin
2020-07-27 23:24   ` Sasha Levin
2020-07-27 23:24 ` [PATCH AUTOSEL 4.19 08/10] x86/unwind/orc: Fix ORC for newly forked tasks Sasha Levin
2020-07-27 23:24 ` Sasha Levin [this message]
2020-07-27 23:24 ` [PATCH AUTOSEL 4.19 10/10] xen-netfront: fix potential deadlock in xennet_remove() Sasha Levin
2020-07-27 23:24   ` Sasha Levin

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=20200727232443.718000-9-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=navid.emamdoost@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.