From patchwork Fri Dec 4 09:10:09 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anisse Astier X-Patchwork-Id: 64831 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB49C3lj027924 for ; Fri, 4 Dec 2009 09:12:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755346AbZLDJLt (ORCPT ); Fri, 4 Dec 2009 04:11:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755568AbZLDJLs (ORCPT ); Fri, 4 Dec 2009 04:11:48 -0500 Received: from mail-ew0-f219.google.com ([209.85.219.219]:45304 "EHLO mail-ew0-f219.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755346AbZLDJLq (ORCPT ); Fri, 4 Dec 2009 04:11:46 -0500 Received: by ewy19 with SMTP id 19so2531124ewy.1 for ; Fri, 04 Dec 2009 01:11:52 -0800 (PST) Received: by 10.213.0.196 with SMTP id 4mr2943825ebc.41.1259917912207; Fri, 04 Dec 2009 01:11:52 -0800 (PST) Received: from destiny.ordissimo (253.175.70-86.rev.gaoland.net [86.70.175.253]) by mx.google.com with ESMTPS id 10sm5089446eyz.23.2009.12.04.01.11.51 (version=SSLv3 cipher=RC4-MD5); Fri, 04 Dec 2009 01:11:52 -0800 (PST) Date: Fri, 4 Dec 2009 10:10:09 +0100 From: Anisse Astier To: Randy Dunlap Cc: linux-acpi@vger.kernel.org, Carlos Corbacho , Len Brown , Frans Pop , Matthew Garrett Subject: [PATCH v2] wmi: Free the allocated acpi objects through wmi_get_event_data Message-ID: <20091204101009.0dccacf3@destiny.ordissimo> In-Reply-To: <20091203100103.ba1ec972.randy.dunlap@oracle.com> References: <20091203172745.02f66489@destiny.ordissimo> <20091203100103.ba1ec972.randy.dunlap@oracle.com> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.12; i486-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c index 0f900cc..f235a98 100644 --- a/drivers/platform/x86/dell-wmi.c +++ b/drivers/platform/x86/dell-wmi.c @@ -180,6 +180,7 @@ static void dell_wmi_notify(u32 value, void *context) printk(KERN_INFO "dell-wmi: Unknown key %x pressed\n", buffer[1] & 0xFFFF); } + kfree(obj); } static int __init dell_wmi_input_setup(void) diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index c284217..36109e1 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c @@ -377,6 +377,8 @@ static void hp_wmi_notify(u32 value, void *context) eventcode); } else printk(KERN_INFO "HP WMI: Unknown response received\n"); + + kfree(obj); } static int __init hp_wmi_input_setup(void) diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 177f8d7..87f4c97 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -510,8 +510,8 @@ EXPORT_SYMBOL_GPL(wmi_remove_notify_handler); /** * wmi_get_event_data - Get WMI data associated with an event * - * @event - Event to find - * &out - Buffer to hold event data + * @event: Event to find + * @out: Buffer to hold event data. out->pointer should be freed with kfree() * * Returns extra data associated with an event in WMI. */