提交 c61519fd 编写于 作者: A Axel Lin 提交者: Mark Brown

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: NAxel Lin <axel.lin@ingics.com>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 2a8d1303
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部