mfd: mfd-core: Protect against NULL call-back function pointer
authorLee Jones <lee.jones@linaro.org>
Mon, 21 Oct 2019 09:16:34 +0000 (10:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2020 18:40:02 +0000 (20:40 +0200)
commit8dec3131a8e52a874a80814350e425ba69fd7ab6
tree363dfd898f52a8e4af8c4e0494201a36111a1383
parenta8fedff397ff335ec88ea7058fa083df037bf9ad
mfd: mfd-core: Protect against NULL call-back function pointer

[ Upstream commit b195e101580db390f50b0d587b7f66f241d2bc88 ]

If a child device calls mfd_cell_{en,dis}able() without an appropriate
call-back being set, we are likely to encounter a panic.  Avoid this
by adding suitable checking.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mfd/mfd-core.c