提交 debe081a 编写于 作者: J jhbird.choi@samsung.com 提交者: Rafael J. Wysocki

PM / Domains: Fix memory leak on error path in pm_genpd_attach_cpuidle

If pm_genpd_attach_cpudidle failed we leak memory stored in 'cpu_data'.
Signed-off-by: NJonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 2978af54
......@@ -1862,7 +1862,7 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state)
cpuidle_drv = cpuidle_driver_ref();
if (!cpuidle_drv) {
ret = -ENODEV;
goto out;
goto err_drv;
}
if (cpuidle_drv->state_count <= state) {
ret = -EINVAL;
......@@ -1884,6 +1884,9 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state)
err:
cpuidle_driver_unref();
err_drv:
kfree(cpu_data);
goto out;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册