Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 575f690d authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

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.

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 98d8618a
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -370,7 +370,7 @@ static int __devinit max8660_probe(struct i2c_client *client,
		return -EINVAL;
		return -EINVAL;
	}
	}


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