X86 platform drivers
 help / color / mirror / Atom feed
From: Zeng Zhaoming <zengzm.kernel@gmail.com>
To: platform-driver-x86@vger.kernel.org
Cc: mjg@redhat.com, Zeng Zhaoming <zengzm.kernel@gmail.com>
Subject: [PATCH] ACPI, hp-wmi: Fix memory leak in acpi query
Date: Fri, 19 Nov 2010 00:46:19 +0800	[thread overview]
Message-ID: <1290098779-2145-1-git-send-email-zengzm.kernel@gmail.com> (raw)

Free acpi return memory after query.

Signed-off-by: Zeng Zhaoming <zengzm.kernel@gmail.com>
---
 drivers/platform/x86/hp-wmi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 drivers/platform/x86/hp-wmi.c

diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
old mode 100644
new mode 100755
index 1dac659..9e05af9
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -172,6 +172,8 @@ static int hp_wmi_perform_query(int query, int write, u32 *buffer,
 	bios_return = *((struct bios_return *)obj->buffer.pointer);
 
 	memcpy(buffer, &bios_return.value, sizeof(bios_return.value));
+
+	kfree(obj);
 	return 0;
 }
 
-- 
1.7.0.4

             reply	other threads:[~2010-11-18 16:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-18 16:46 Zeng Zhaoming [this message]
2010-11-24 16:53 ` [PATCH] ACPI, hp-wmi: Fix memory leak in acpi query Matthew Garrett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1290098779-2145-1-git-send-email-zengzm.kernel@gmail.com \
    --to=zengzm.kernel@gmail.com \
    --cc=mjg@redhat.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox