From: Mina Almasry <almasrymina@google.com>
To: Alexander Lobakin <aleksander.lobakin@intel.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Naman Gulati <namangulati@google.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Mina Almasry <almasrymina@google.com>
Subject: [PATCH net] idpf: free the skb on TX DMA mapping errors
Date: Sat, 24 Oct 2026 03:04:01 +0000 [thread overview]
Message-ID: <20261024030401.852598-1-almasrymina@google.com> (raw)
From: Naman Gulati <namangulati@google.com>
When a DMA mapping fails in idpf_tx_splitq_map() or
idpf_tx_singleq_map(), the unwind walks the buffers with
libeth_tx_complete(). The first buffer is still typed LIBETH_SQE_FRAG
(or LIBETH_SQE_EMPTY if the linear data mapping itself failed) at that
point, so it is only unmapped and the skb is never freed. The callers
return NETDEV_TX_OK and do not touch the skb either, so it leaks.
Free the skb at the end of the unwind.
Fixes: d9028db618a6 ("idpf: convert to libeth Tx buffer completion")
Signed-off-by: Naman Gulati <namangulati@google.com>
Signed-off-by: Mina Almasry <almasrymina@google.com>
---
drivers/net/ethernet/intel/idpf/idpf_singleq_txrx.c | 2 ++
drivers/net/ethernet/intel/idpf/idpf_txrx.c | 3 +++
2 files changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/intel/idpf/idpf_singleq_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_singleq_txrx.c
index e3ddf18dcbf51..010903260ff6f 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_singleq_txrx.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_singleq_txrx.c
@@ -228,6 +228,8 @@ static void idpf_tx_singleq_dma_map_error(struct idpf_tx_queue *txq,
/* Update tail in case netdev_xmit_more was previously true */
idpf_tx_buf_hw_update(txq, idx, false);
+
+ dev_kfree_skb_any(skb);
}
/**
diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
index 885df6294ad94..a92e2457781e6 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
@@ -2606,6 +2606,7 @@ static void idpf_tx_splitq_pkt_err_unmap(struct idpf_tx_queue *txq,
struct idpf_sw_queue *refillq = txq->refillq;
struct libeth_sq_napi_stats ss = { };
struct idpf_tx_buf *tx_buf = first;
+ struct sk_buff *skb = first->skb;
struct libeth_cq_pp cp = {
.dev = txq->dev,
.ss = &ss,
@@ -2621,6 +2622,8 @@ static void idpf_tx_splitq_pkt_err_unmap(struct idpf_tx_queue *txq,
libeth_tx_complete(tx_buf, &cp);
}
+ dev_kfree_skb_any(skb);
+
/* Update tail in case netdev_xmit_more was previously true. */
idpf_tx_buf_hw_update(txq, params->prev_ntu, false);
base-commit: 7076f684d5132e6a6145e1da2fa74771ecd052e5
--
2.56.0.257.gf7497c7d27-goog
next reply other threads:[~2026-10-24 3:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-24 3:04 Mina Almasry [this message]
2026-10-24 3:05 ` netdev-bot+sinfo
2026-10-24 3:09 ` Mina Almasry
2026-10-25 3:04 ` netdev-bot+sashiko
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=20261024030401.852598-1-almasrymina@google.com \
--to=almasrymina@google.com \
--cc=aleksander.lobakin@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=namangulati@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.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
all inboxes | Powered by JetHome®