Skip to contentSkip to conversation

regulator: da9211: Check return value of devm_kzalloc()

PATCH Applied Axel Lin 2 participants 2 messages Aug 17, 2014

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: da9211: Check return value of devm_kzalloc()

---
 drivers/regulator/da9211-regulator.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/regulator/da9211-regulator.c +2 -0
index ccc2e36..a26f1d2 100644
@@ -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);
Signature · 1 line
1.9.1