Commit 8db06423 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown

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: c860476b ("regulator: da9121: Add device variant regmaps")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarAdam Ward <Adam.Ward.opensource@diasemi.com>
Link: https://lore.kernel.org/r/X85soGKnWAjPUA7a@mwandaSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent bebb2c6d
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment