diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-08-28 09:04:49 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-08-28 11:01:25 -0400 |
commit | c61519fd9abb1b520bcbe2eb21cf161d4d1b9eec (patch) | |
tree | e4ef84b58e7d72ed809e5e3e8c25884d09f679bb | |
parent | 2a8d1303c6618f44e7603a4625783d1aff5fef4a (diff) |
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: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | drivers/regulator/rk808-regulator.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c index f42952ead1bd..0d11df131eba 100644 --- a/drivers/regulator/rk808-regulator.c +++ b/drivers/regulator/rk808-regulator.c | |||
@@ -342,7 +342,7 @@ static int rk808_regulator_probe(struct platform_device *pdev) | |||
342 | int ret = 0; | 342 | int ret = 0; |
343 | 343 | ||
344 | if (!pdata) { | 344 | if (!pdata) { |
345 | pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL); | 345 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); |
346 | if (!pdata) | 346 | if (!pdata) |
347 | return -ENOMEM; | 347 | return -ENOMEM; |
348 | } | 348 | } |