regulator: da9211: Check return value of devm_kzalloc()

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
Axel Lin 2014-08-17 18:34:48 +08:00 committed by Mark Brown
parent 005547e082
commit 1d3e6a6985

View File

@ -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);