aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/page_pool.c
diff options
context:
space:
mode:
authorMina Almasry <[email protected]>2025-08-21 03:03:46 +0000
committerJakub Kicinski <[email protected]>2025-08-22 22:52:02 +0000
commitabadf0ff63be488dc502ecfc9f622929a21b7117 (patch)
tree98c3de2a6c94f969f940f709997693f489481ddb /net/core/page_pool.c
parentnet: macb: fix unregister_netdev call order in macb_remove() (diff)
downloadkernel-abadf0ff63be488dc502ecfc9f622929a21b7117.tar.gz
kernel-abadf0ff63be488dc502ecfc9f622929a21b7117.zip
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. Cc: [email protected] Fixes: b400f4b87430 ("page_pool: Set `dma_sync` to false for devmem memory provider") Signed-off-by: Mina Almasry <[email protected]> Reviewed-by: Samiullah Khawaja <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/core/page_pool.c')
-rw-r--r--net/core/page_pool.c6
1 files 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;