mfd: max8998: Fix potential NULL pointer dereference
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Wed, 5 Jul 2017 05:50:54 +0000 (07:50 +0200)
committerLee Jones <lee.jones@linaro.org>
Tue, 5 Sep 2017 07:46:00 +0000 (08:46 +0100)
commit2042f3c29f2f11129434de8a610878e8a15b4174
tree75fe955c2a9a9298794cb9e5d672301a4ece2386
parent0953075112d7626474b0bb88690f5f1ab93ec803
mfd: max8998: Fix potential NULL pointer dereference

if 'max8998_i2c_parse_dt_pdata() fails (when out of memory), a NULL
pointer dereference will occur in the error handling code.

Return directly instead.

Fixes: ee999fb3f17f("mfd: max8998: Add support for Device Tree")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/max8998.c