page_pool: fix incorrect mp_ops error handling
Subsystems (3)
PATCH 1/1 page_pool: fix incorrect mp_ops error handling
Minor fix to the memory provider error handling, we should be jumping to free_ptr_ring in this error case rather than returning directly.
Found by code-inspection.
--- net/core/page_pool.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/core/page_pool.c +4 -2
@@ -287,8 +287,10 @@ static int page_pool_init(struct page_pool *pool, }if (pool->mp_ops) { -if (!pool->dma_map || !pool->dma_sync) -return -EOPNOTSUPP ; +if (!pool->dma_map || !pool->dma_sync) { + err = -EOPNOTSUPP ; + goto free_ptr_ring; + }if (WARN_ON (!is_kernel_rodata ((unsigned long )pool->mp_ops))) { err = -EFAULT ;
base-commit: c42be534547d6e45c155c347dd792b6ad9c24def
Signature · 1 line
2.51.0.rc1.193.gad69d77794-goog
Quoted 33 lines · Mina Almasry
Minor fix to the memory provider error handling, we should be jumping to
free_ptr_ringin this error case rather than returning directly.Found by code-inspection.
Fixes b400f4b87430 ("page_pool: Set `dma_sync` to false for devmem memory provider")Signed-off-by Mina Almasry <[email protected]>--- net/core/page_pool.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)net/core/page_pool.c +4
-2@@ -287,8 +287,10 @@ static int page_pool_init(struct page_pool *pool, }if (pool->mp_ops) { -if (!pool->dma_map || !pool->dma_sync) -return -EOPNOTSUPP ; +if (!pool->dma_map || !pool->dma_sync) { + err = -EOPNOTSUPP ; + goto free_ptr_ring; + }if (WARN_ON (!is_kernel_rodata ((unsigned long )pool->mp_ops))) { err = -EFAULT ;
Quoted 4 lines
base-commit:
c42be534547d6e45c155c347dd792b6ad9c24def--
2.51.0.rc1.193.gad69d77794-goog
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Thu, 21 Aug 2025 03:03:46 +0000 you wrote:
Minor fix to the memory provider error handling, we should be jumping to
free_ptr_ringin this error case rather than returning directly.Found by code-inspection.
[...]
Here is the summary with links:
- [net,v1] page_pool: fix incorrect mp_ops error handling
https://git.kernel.org/netdev/net/c/abadf0ff63be
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html