summaryrefslogtreecommitdiff
path: root/drivers/regulator/da9121-regulator.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-12-07 20:55:44 +0300
committerMark Brown <broonie@kernel.org>2020-12-08 17:21:13 +0300
commit8db06423e079b1f6c0657e5bebda0006acf75c3c (patch)
tree6060f6b51705f9fbf920b28c83df532a8db0e395 /drivers/regulator/da9121-regulator.c
parentbebb2c6d5ca23d6b7556d39564212b619e068562 (diff)
downloadlinux-8db06423e079b1f6c0657e5bebda0006acf75c3c.tar.xz
regulator: da9121: Potential Oops in da9121_assign_chip_model()
There is a missing "return ret;" on this error path so we call "da9121_check_device_type(i2c, chip);" which will end up dereferencing "chip->regmap" and lead to an Oops. Fixes: c860476b9e3a ("regulator: da9121: Add device variant regmaps") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/X85soGKnWAjPUA7a@mwanda Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/da9121-regulator.c')
-rw-r--r--drivers/regulator/da9121-regulator.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/regulator/da9121-regulator.c b/drivers/regulator/da9121-regulator.c
index db1c2cc838bc..e4fc3a7cd5d8 100644
--- a/drivers/regulator/da9121-regulator.c
+++ b/drivers/regulator/da9121-regulator.c
@@ -915,6 +915,7 @@ static int da9121_assign_chip_model(struct i2c_client *i2c,
ret = PTR_ERR(chip->regmap);
dev_err(chip->dev, "Failed to configure a register map: %d\n",
ret);
+ return ret;
}
ret = da9121_check_device_type(i2c, chip);