Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e56c9256 authored by Josh Hunt's avatar Josh Hunt Committed by Rafael J. Wysocki
Browse files

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: default avatarJosh Hunt <johunt@akamai.com>
Reviewed-by: default avatarChen, Gong <gong.chen@linux.intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent f6cede5b
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -536,7 +536,8 @@ int apei_resources_request(struct apei_resources *resources,
		goto err_unmap_ioport;
		goto err_unmap_ioport;
	}
	}


	return 0;
	goto arch_res_fini;

err_unmap_ioport:
err_unmap_ioport:
	list_for_each_entry(res, &resources->ioport, list) {
	list_for_each_entry(res, &resources->ioport, list) {
		if (res == res_bak)
		if (res == res_bak)
@@ -551,6 +552,7 @@ int apei_resources_request(struct apei_resources *resources,
		release_mem_region(res->start, res->end - res->start);
		release_mem_region(res->start, res->end - res->start);
	}
	}
arch_res_fini:
arch_res_fini:
	if (arch_apei_filter_addr)
		apei_resources_fini(&arch_res);
		apei_resources_fini(&arch_res);
nvs_res_fini:
nvs_res_fini:
	apei_resources_fini(&nvs_resources);
	apei_resources_fini(&nvs_resources);