mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-12 15:24:00 +08:00
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:
parent
005547e082
commit
1d3e6a6985
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user