]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.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)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 9 Apr 2026 13:17:23 +0000 (15:17 +0200)
commit076344a6ad9d1308faaed1402fdcfdda68b604ab
tree5292db058a330055dcae89513132574c3e2b68ea
parent3fd0da4fd8851a7e62d009b7db6c4a05b092bc19
net: lan966x: fix page pool leak in error paths

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>
drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c