Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: skhawaja@google.com

Fixes: b400f4b87430 ("page_pool: Set `dma_sync` to false for devmem memory provider")
Signed-off-by: Mina Almasry <almasrymina@google.com>
Reviewed-by: Samiullah Khawaja <skhawaja@google.com>
Link: https://patch.msgid.link/20250821030349.705244-1-almasrymina@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Mina Almasry and committed by
Jakub Kicinski
abadf0ff 01b9128c

+4 -2
+4 -2
net/core/page_pool.c
··· 287 287 } 288 288 289 289 if (pool->mp_ops) { 290 - if (!pool->dma_map || !pool->dma_sync) 291 - return -EOPNOTSUPP; 290 + if (!pool->dma_map || !pool->dma_sync) { 291 + err = -EOPNOTSUPP; 292 + goto free_ptr_ring; 293 + } 292 294 293 295 if (WARN_ON(!is_kernel_rodata((unsigned long)pool->mp_ops))) { 294 296 err = -EFAULT;