[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1210212233180.26319@swampdragon.chaosbits.net>
Date:	Sun, 21 Oct 2012 22:35:46 +0200 (CEST)
From:	Jesper Juhl <jj@...osbits.net>
To:	linux-acpi@...r.kernel.org
cc:	linux-kernel@...r.kernel.org, Len Brown <lenb@...nel.org>,
	Lin Ming <ming.m.lin@...el.com>,
	Bob Moore <robert.moore@...el.com>
Subject: [PATCH] ACPICA: Don't leak next_walk_state in
 acpi_ds_call_control_method()
If acpi_ds_create_walk_state() succeeds, but the call to
ACPI_ALLOCATE_ZEROED() fails, then we'll return from the function
without properly freeing 'next_walk_state'.
Signed-off-by: Jesper Juhl <jj@...osbits.net>
---
 drivers/acpi/acpica/dsmethod.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index aa9a5d4..ade59a3 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -378,7 +378,8 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
 	 */
 	info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
 	if (!info) {
-		return_ACPI_STATUS(AE_NO_MEMORY);
+		status = AE_NO_MEMORY;
+		goto cleanup;
 	}
 
 	info->parameters = &this_walk_state->operands[0];
-- 
1.7.1
-- 
Jesper Juhl <jj@...osbits.net>       http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Powered by blists - more mailing lists
 
