Skip to content

Commit

Permalink
regulator: max8660: Fix a memory leak due to missing devm_kzalloc con…
Browse files Browse the repository at this point in the history
…version

commit 4d26f7 "regulator: max8660: Use devm_kzalloc()" missed to
replace kzalloc by devm_kzalloc. Fix it.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Axel Lin authored and Mark Brown committed Apr 17, 2012
1 parent 98d8618 commit 575f690
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/regulator/max8660.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ static int __devinit max8660_probe(struct i2c_client *client,
return -EINVAL;
}

max8660 = kzalloc(sizeof(struct max8660) +
max8660 = devm_kzalloc(&client->dev, sizeof(struct max8660) +
sizeof(struct regulator_dev *) * MAX8660_V_END,
GFP_KERNEL);
if (!max8660)
Expand Down

0 comments on commit 575f690

Please sign in to comment.