* [PATCH net v1] page_pool: fix incorrect mp_ops error handling
@ 2025-08-21 3:03 Mina Almasry
2025-08-21 23:08 ` Samiullah Khawaja
2025-08-22 23:10 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Mina Almasry @ 2025-08-21 3:03 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: Mina Almasry, Jesper Dangaard Brouer, Ilias Apalodimas,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, skhawaja
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.
Cc: skhawaja@google.com
Fixes: b400f4b87430 ("page_pool: Set `dma_sync` to false for devmem memory provider")
Signed-off-by: Mina Almasry <almasrymina@google.com>
---
net/core/page_pool.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/core/page_pool.c b/net/core/page_pool.c
index 343a6cac21e3..ba70569bd4b0 100644
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -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
--
2.51.0.rc1.193.gad69d77794-goog
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net v1] page_pool: fix incorrect mp_ops error handling
2025-08-21 3:03 [PATCH net v1] page_pool: fix incorrect mp_ops error handling Mina Almasry
@ 2025-08-21 23:08 ` Samiullah Khawaja
2025-08-22 23:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Samiullah Khawaja @ 2025-08-21 23:08 UTC (permalink / raw)
To: Mina Almasry
Cc: netdev, linux-kernel, Jesper Dangaard Brouer, Ilias Apalodimas,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman
On Wed, Aug 20, 2025 at 8:03 PM Mina Almasry <almasrymina@google.com> wrote:
>
> 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.
>
> Cc: skhawaja@google.com
>
> Fixes: b400f4b87430 ("page_pool: Set `dma_sync` to false for devmem memory provider")
> Signed-off-by: Mina Almasry <almasrymina@google.com>
>
> ---
> net/core/page_pool.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/net/core/page_pool.c b/net/core/page_pool.c
> index 343a6cac21e3..ba70569bd4b0 100644
> --- a/net/core/page_pool.c
> +++ b/net/core/page_pool.c
> @@ -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
> --
> 2.51.0.rc1.193.gad69d77794-goog
>
Reviewed-by: Samiullah Khawaja <skhawaja@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net v1] page_pool: fix incorrect mp_ops error handling
2025-08-21 3:03 [PATCH net v1] page_pool: fix incorrect mp_ops error handling Mina Almasry
2025-08-21 23:08 ` Samiullah Khawaja
@ 2025-08-22 23:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-08-22 23:10 UTC (permalink / raw)
To: Mina Almasry
Cc: netdev, linux-kernel, hawk, ilias.apalodimas, davem, edumazet,
kuba, pabeni, horms, skhawaja
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
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_ring in this error case rather than returning directly.
>
> Found by code-inspection.
>
> Cc: skhawaja@google.com
>
> [...]
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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-22 23:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-21 3:03 [PATCH net v1] page_pool: fix incorrect mp_ops error handling Mina Almasry
2025-08-21 23:08 ` Samiullah Khawaja
2025-08-22 23:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®