regulator: rt4801: Fix NULL pointer dereference if priv->enable_gpios is NULL
authorAxel Lin <axel.lin@ingics.com>
Thu, 3 Jun 2021 09:49:44 +0000 (17:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Jun 2021 12:42:48 +0000 (14:42 +0200)
commitba8a26a7ce8617f9f3d6230de34b2302df086b41
treecdc794e11ba71853e6f2cf3305f76cd4f3cf49ae
parent2f8f0e97cebb6c2b7cffd5b7c08331535680ae40
regulator: rt4801: Fix NULL pointer dereference if priv->enable_gpios is NULL

[ Upstream commit cb2381cbecb81a8893b2d1e1af29bc2e5531df27 ]

devm_gpiod_get_array_optional may return NULL if no GPIO was assigned.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210603094944.1114156-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/regulator/rt4801-regulator.c