diff options
author | jhbird.choi@samsung.com <jhbird.choi@samsung.com> | 2012-10-22 22:54:38 (GMT) |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-10-22 22:54:38 (GMT) |
commit | debe081aaa4d247b9957ac2336d84deab32d9909 (patch) | |
tree | 0ca76f03976a6763a57d893c0c9f3340e73bbcc4 /drivers | |
parent | 2978af545b9a1ed221e23fb24ae4559bec6ad70d (diff) | |
download | linux-fsl-qoriq-debe081aaa4d247b9957ac2336d84deab32d9909.tar.xz |
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: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/power/domain.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index c22b869..96b71b6 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -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; } |