mfd: rk808: avoid NULL pointer dereferencing when shutdown

rk808->pins maybe NULL.

Fixes: cfe40315e8 ("pinctrl: support pinctrl driver for the RK817&RK809 PMIC")
Change-Id: Ia2c25f2717498c06d0707f17d27b0a85ee23f229
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
This commit is contained in:
Tao Huang 2018-04-08 15:25:38 +08:00
parent 8ace8303d0
commit bd67d49f2b

View File

@ -797,7 +797,7 @@ static void rk817_shutdown_prepare(void)
RK817_RTC_INT_REG,
(0x3 << 2), (0x0 << 2));
if (rk808->pins->p && rk808->pins->power_off) {
if (rk808->pins && rk808->pins->p && rk808->pins->power_off) {
ret = regmap_update_bits(rk808->regmap,
RK817_SYS_CFG(3),
RK817_SLPPIN_FUNC_MSK,