diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-08-17 18:34:48 +0800 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-08-17 08:55:16 -0500 |
commit | 1d3e6a6985c14f0510ebbd81fb9e8c02b24f8791 (patch) | |
tree | 72e247eca5d064d9154e9d8c6de3261b7b18a081 | |
parent | 005547e0828ce9064afebb1e6d56a18efd80e7a3 (diff) |
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>
-rw-r--r-- | drivers/regulator/da9211-regulator.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/regulator/da9211-regulator.c b/drivers/regulator/da9211-regulator.c index ccc2e362d751..a26f1d283c57 100644 --- a/drivers/regulator/da9211-regulator.c +++ b/drivers/regulator/da9211-regulator.c @@ -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); |