Skip to contentSkip to conversation

regulator: max8660: Fix a memory leak due to missing devm_kzalloc conversion

PATCH Applied Axel Lin 2 participants 2 messages Apr 17, 2012 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: max8660: Fix a memory leak due to missing devm_kzalloc conversion

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

---
 drivers/regulator/max8660.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/regulator/max8660.c +1 -1
index 9997cfb..5d56817 100644
@@ -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)
Signature · 1 line
1.7.5.4
Applied
#1 lore raw
Quoted 2 lines · Axel Lin

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

Applied, thanks.