aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Hunt <johunt@akamai.com>2016-03-08 10:52:11 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-03-10 18:13:25 -0500
commite56c92565dfe2c8de203f42f7d5237d14784b93d (patch)
treef93e643da2d55c54b32410ecf9d589f8a87a8619
parentf6cede5b49e822ebc41a099fe41ab4989f64e2cb (diff)
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>
-rw-r--r--drivers/acpi/apei/apei-base.c6
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,
536 goto err_unmap_ioport; 536 goto err_unmap_ioport;
537 } 537 }
538 538
539 return 0; 539 goto arch_res_fini;
540
540err_unmap_ioport: 541err_unmap_ioport:
541 list_for_each_entry(res, &resources->ioport, list) { 542 list_for_each_entry(res, &resources->ioport, list) {
542 if (res == res_bak) 543 if (res == res_bak)
@@ -551,7 +552,8 @@ err_unmap_iomem:
551 release_mem_region(res->start, res->end - res->start); 552 release_mem_region(res->start, res->end - res->start);
552 } 553 }
553arch_res_fini: 554arch_res_fini:
554 apei_resources_fini(&arch_res); 555 if (arch_apei_filter_addr)
556 apei_resources_fini(&arch_res);
555nvs_res_fini: 557nvs_res_fini:
556 apei_resources_fini(&nvs_resources); 558 apei_resources_fini(&nvs_resources);
557 return rc; 559 return rc;