]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: lan966x: fix page pool leak in error paths
authorDavid Carlier <devnexen@gmail.com>
Sun, 5 Apr 2026 05:52:40 +0000 (06:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Apr 2026 08:46:46 +0000 (10:46 +0200)
commit4941e234cfd67ac911fb259642b453f9f76aac41
tree28da7579add5d5e9378a1cbde5d6de592eb56dbd
parent7caf90d9ab97951a58d1de85ab7e7d7cca7a4513
net: lan966x: fix page pool leak in error paths

commit 076344a6ad9d1308faaed1402fdcfdda68b604ab upstream.

lan966x_fdma_rx_alloc() creates a page pool but does not destroy it if
the subsequent fdma_alloc_coherent() call fails, leaking the pool.

Similarly, lan966x_fdma_init() frees the coherent DMA memory when
lan966x_fdma_tx_alloc() fails but does not destroy the page pool that
was successfully created by lan966x_fdma_rx_alloc(), leaking it.

Add the missing page_pool_destroy() calls in both error paths.

Fixes: 11871aba1974 ("net: lan96x: Use page_pool API")
Cc: stable@vger.kernel.org
Signed-off-by: David Carlier <devnexen@gmail.com>
Link: https://patch.msgid.link/20260405055241.35767-3-devnexen@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c