diff options
author | Josh Hunt <johunt@akamai.com> | 2016-03-08 10:52:11 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-03-11 00:13:25 +0100 |
commit | e56c92565dfe2c8de203f42f7d5237d14784b93d (patch) | |
tree | f93e643da2d55c54b32410ecf9d589f8a87a8619 /drivers/acpi | |
parent | f6cede5b49e822ebc41a099fe41ab4989f64e2cb (diff) | |
download | linux-e56c92565dfe2c8de203f42f7d5237d14784b93d.tar.gz linux-e56c92565dfe2c8de203f42f7d5237d14784b93d.tar.bz2 linux-e56c92565dfe2c8de203f42f7d5237d14784b93d.zip |
ACPI / APEI: Fix leaked resources
We leak the NVS and arch resources (if used), in apei_resources_request.
They are allocated to make sure we exclude them from the APEI resources,
but they are never freed at the end of the function. Free them now.
Signed-off-by: Josh Hunt <johunt@akamai.com>
Reviewed-by: Chen, Gong <gong.chen@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/apei/apei-base.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c index a2c8d7adb6eb..da370e1d31f4 100644 --- a/drivers/acpi/apei/apei-base.c +++ b/drivers/acpi/apei/apei-base.c @@ -536,7 +536,8 @@ int apei_resources_request(struct apei_resources *resources, goto err_unmap_ioport; } - return 0; + goto arch_res_fini; + err_unmap_ioport: list_for_each_entry(res, &resources->ioport, list) { if (res == res_bak) @@ -551,7 +552,8 @@ err_unmap_iomem: release_mem_region(res->start, res->end - res->start); } arch_res_fini: - apei_resources_fini(&arch_res); + if (arch_apei_filter_addr) + apei_resources_fini(&arch_res); nvs_res_fini: apei_resources_fini(&nvs_resources); return rc; |