Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932953AbcCHQAH (ORCPT ); Tue, 8 Mar 2016 11:00:07 -0500 Received: from prod-mail-xrelay07.akamai.com ([23.79.238.175]:40863 "EHLO prod-mail-xrelay07.akamai.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932653AbcCHQAC (ORCPT ); Tue, 8 Mar 2016 11:00:02 -0500 X-Greylist: delayed 467 seconds by postgrey-1.27 at vger.kernel.org; Tue, 08 Mar 2016 11:00:02 EST From: Joshua Hunt To: gong.chen@intel.com, linux-acpi@vger.kernel.org, rjw@rjwysocki.net, lenb@kernel.org, ying.huang@intel.com Cc: tony.luck@intel.com, linux-kernel@vger.kernel.org, Joshua Hunt Subject: [PATCH v2 2/2] ACPI, APEI, ERST: Fixed leaked resources in erst_init Date: Tue, 8 Mar 2016 10:52:12 -0500 Message-Id: <1457452332-2673-3-git-send-email-johunt@akamai.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1457452332-2673-1-git-send-email-johunt@akamai.com> References: <1457452332-2673-1-git-send-email-johunt@akamai.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 737 Lines: 25 erst_init currently leaks resources allocated from its call to apei_resources_init(). The data allocated there gets copied into apei_resources_all and can be freed when we're done with it. Signed-off-by: Josh Hunt --- drivers/acpi/apei/erst.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c index 6e6bc10..006c389 100644 --- a/drivers/acpi/apei/erst.c +++ b/drivers/acpi/apei/erst.c @@ -1207,6 +1207,9 @@ static int __init erst_init(void) "Failed to allocate %lld bytes for persistent store error log.\n", erst_erange.size); + /* Cleanup ERST Resources */ + apei_resources_fini(&erst_resources); + return 0; err_release_erange: -- 1.7.9.5