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

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

regulator: rk808: Fix memory leak



The memory allocated in rk808_regulator_probe() needs to be freed when the
module is unloaded. Thus pass &pdev->dev rather than &client->dev to
devm_kzalloc.

Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 2a8d1303
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -342,7 +342,7 @@ static int rk808_regulator_probe(struct platform_device *pdev)
	int ret = 0;

	if (!pdata) {
		pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
		pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
		if (!pdata)
			return -ENOMEM;
	}