🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Wentao Liang Tue, 03 Nov 2026 10:28
[PATCH] net: lan969x: fix page pool leak when RX DMA allocation fails
#10280
Author: Wentao Liang
Date: Tue, 03 Nov 2026 10:28
36 lines
9473 bytes
lan969x_fdma_rx_alloc() creates the RX page pool and then allocates the
FDMA coherent memory. If fdma_alloc_coherent() fails, the function
returns without destroying the page pool.

The failure propagates out of lan969x_fdma_init(), and
sparx5_frame_io_init() then marks the FDMA IRQ as unavailable, so
lan969x_fdma_deinit() is never called on teardown and the page pool is
never released. Destroy it before returning the error.

Fixes: d84ad2c0d80c ("net: lan969x: add FDMA implementation")
Cc: stable@vger.kernel.org
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_fdma.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_fdma.c b/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_fdma.c
index 053d125eda65..bc293ba1707d 100644
--- a/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_fdma.c
+++ b/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_fdma.c
@@ -169,8 +169,10 @@ static int lan969x_fdma_rx_alloc(struct sparx5 *sparx5)
 		return PTR_ERR(rx->page_pool);
 
 	err = fdma_alloc_coherent(sparx5->dev, fdma);
-	if (err)
+	if (err) {
+		page_pool_destroy(rx->page_pool);
 		return err;
+	}
 
 	fdma_dcbs_init(fdma,
 		       FDMA_DCB_INFO_DATAL(fdma->db_size),
-- 
2.34.1
Re: [PATCH] net: lan969x: fix page pool leak when RX DMA allocation fails
#10234
Author: netdev-bot+sinfo
Date: Tue, 03 Nov 2026 10:34
26 lines
9032 bytes
Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - How the issue was discovered, e.g. hit in production, hit during
   development, syzbot report, manual code inspection, LLM or static
   analysis tool scan.

 - Whether the issue was actually triggered, or is only theoretical
   (e.g. found by code inspection). If it was triggered please include
   the symptoms, like the stack trace or error messages.

 - What hardware the change was tested on. For driver fixes please
   mention the device (and if relevant firmware version) used for
   testing, or say that the change was not tested on real hardware.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.

The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads