soc: fsl: qbman: qman: avoid allocating from non existing gen_pool
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 23 Aug 2018 21:36:00 +0000 (23:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Nov 2018 15:42:42 +0000 (07:42 -0800)
commitfce84f75e518f9368d371f05e5f48e9b48496e42
tree27a8248b42a24a5259f33ef9860b811aa256e5dd
parent05bdb6d96456e36fe962dc62856d9aab3a87b70b
soc: fsl: qbman: qman: avoid allocating from non existing gen_pool

[ Upstream commit 64e9e22e68512da8df3c9a7430f07621e48db3c2 ]

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
dereference.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Roy Pledge <roy.pledge@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
(cherry picked from commit f72487a2788aa70c3aee1d0ebd5470de9bac953a)
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/soc/fsl/qbman/qman.c