Commit 795b1303 authored by Alexandre Belloni's avatar Alexandre Belloni Committed by Greg Kroah-Hartman

soc: fsl: qbman: qman: avoid allocating from non existing gen_pool

[ Upstream commit 64e9e22e ]

If the qman driver didn't probe, calling qman_alloc_fqid_range,
qman_alloc_pool_range or qman_alloc_cgrid_range (as done in dpaa_eth) will
pass a NULL pointer to gen_pool_alloc, leading to a NULL pointer
Signed-off-by: default avatarAlexandre Belloni <>
Reviewed-by: default avatarRoy Pledge <>
Signed-off-by: default avatarLi Yang <>
(cherry picked from commit f72487a2788aa70c3aee1d0ebd5470de9bac953a)
Signed-off-by: default avatarOlof Johansson <>
Signed-off-by: default avatarSasha Levin <>
parent d9e74276
......@@ -2699,6 +2699,9 @@ static int qman_alloc_range(struct gen_pool *p, u32 *result, u32 cnt)
unsigned long addr;
if (!p)
return -ENODEV;
addr = gen_pool_alloc(p, cnt);
if (!addr)
return -ENOMEM;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment