From patchwork Sun Oct 21 20:35:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Juhl X-Patchwork-Id: 1623071 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 1FAC1400E9 for ; Sun, 21 Oct 2012 20:35:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754288Ab2JUUft (ORCPT ); Sun, 21 Oct 2012 16:35:49 -0400 Received: from 1010ds2-suoe.0.fullrate.dk ([90.184.90.115]:27851 "EHLO swampdragon.chaosbits.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753634Ab2JUUfs (ORCPT ); Sun, 21 Oct 2012 16:35:48 -0400 Received: by swampdragon.chaosbits.net (Postfix, from userid 1000) id 2C1E29403D; Sun, 21 Oct 2012 22:35:47 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by swampdragon.chaosbits.net (Postfix) with ESMTP id 1F39C9403B; Sun, 21 Oct 2012 22:35:47 +0200 (CEST) Date: Sun, 21 Oct 2012 22:35:46 +0200 (CEST) From: Jesper Juhl To: linux-acpi@vger.kernel.org cc: linux-kernel@vger.kernel.org, Len Brown , Lin Ming , Bob Moore Subject: [PATCH] ACPICA: Don't leak next_walk_state in acpi_ds_call_control_method() Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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 --- 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];