Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Simon Horman
Wed, 25 Nov 2026 10:38
Re: [PATCH v5 net 2/4] net: hns3: fix page_pool leak in hns3_alloc_ring_memory error path
Author: Simon Horman
Date: Wed, 25 Nov 2026 10:38
Date: Wed, 25 Nov 2026 10:38
26 lines
9061 bytes
9061 bytes
On Wed, Nov 18, 2026 at 09:03:28PM +0800, Jijie Shao wrote:
> In hns3_alloc_ring_memory(), when hns3_alloc_ring_buffers() fails for
> an RX ring, the error path jumps to out_with_desc, which frees the
> descriptor ring but does not destroy the page_pool that was just
> allocated by hns3_alloc_page_pool(). The page_pool and its pages are
> leaked.
>
> Destroy the page_pool in that error path as well. The pool is torn down
> before the descriptor ring here, which is the opposite of the order in
> hns3_fini_ring(); that is safe because hns3_alloc_ring_buffers() has
> already detached every buffer it attached, so hns3_free_desc() walks
> descriptors whose dma is zero and never hands a page back to the pool.
>
> Fixes: 93188e9642c3 ("net: hns3: support skb's frag page recycling based on page pool")
> Signed-off-by: Jijie Shao <shaojijie@huawei.com>
> ---
> Changes in v4:
> - Name hns3_fini_ring() instead of the non-existent
> hns3_free_ring_memory(), and drop "mirroring" because the destroy
> order differs. The pool is destroyed before the descriptor ring
> here, which is safe because hns3_alloc_ring_buffers() has already
> detached every buffer.
> v3: https://lore.kernel.org/all/20261030095633.377289-3-shaojijie@huawei.com/
Reviewed-by: Simon Horman <horms@kernel.org>
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