Skip to content
Permalink
Browse files
page_pool: fix NULL dereference crash
Check for the existence of page pool params before dereferencing. This can
cause crashes in certain conditions.

Fixes: 35b2e54 ("page_pool: Add callback to init pages when they are
allocated")

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
  • Loading branch information
colin-foster-in-advantage authored and intel-lab-lkp committed Jan 22, 2022
1 parent 03c82e8 commit 6b2d9e5c2901873c8bba988d4db6cd5bfbaaeec4
Showing 1 changed file with 1 addition and 1 deletion.
@@ -213,7 +213,7 @@ static void page_pool_set_pp_info(struct page_pool *pool,
{
page->pp = pool;
page->pp_magic |= PP_SIGNATURE;
if (pool->p.init_callback)
if (pool->p && pool->p.init_callback)
pool->p.init_callback(page, pool->p.init_arg);
}

0 comments on commit 6b2d9e5

Please sign in to comment.