regulator: da9211: Check return value of devm_kzalloc()
PATCH 1/1 regulator: da9211: Check return value of devm_kzalloc()
Signed-off-by Axel Lin <[email protected]>
--- drivers/regulator/da9211-regulator.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/regulator/da9211-regulator.c +2 -0
@@ -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
Quoted 1 line · Axel Lin
Signed-off-by Axel Lin <[email protected]>
Applied, thanks.