Skip to content

Commit 69d75cb

Browse files
minagregkh
authored andcommitted
page_pool: fix incorrect mp_ops error handling
[ Upstream commit abadf0f ] 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: b400f4b ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 42f0533 commit 69d75cb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

net/core/page_pool.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,10 @@ static int page_pool_init(struct page_pool *pool,
287287
}
288288

289289
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+
}
292294

293295
if (WARN_ON(!is_kernel_rodata((unsigned long)pool->mp_ops))) {
294296
err = -EFAULT;

0 commit comments

Comments
 (0)