Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d3e6a69 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

regulator: da9211: Check return value of devm_kzalloc()



Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 005547e0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -343,6 +343,8 @@ static int da9211_i2c_probe(struct i2c_client *i2c,
	unsigned int data;

	chip = devm_kzalloc(&i2c->dev, sizeof(struct da9211), GFP_KERNEL);
	if (!chip)
		return -ENOMEM;

	chip->dev = &i2c->dev;
	chip->regmap = devm_regmap_init_i2c(i2c, &da9211_regmap_config);