summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2009-12-18 15:29:23 +0100
committerLen Brown <len.brown@intel.com>2009-12-24 00:54:49 -0500
commit44ef00e6482e755f36629773abc2aee83a6f53e3 (patch)
tree6552ee01bf2c1aa9c461df7cc1823a94899610ba
parent4d5f177caf1ef78f5e7eaee75b66b4d534445682 (diff)
downloadlinux-3.10-44ef00e6482e755f36629773abc2aee83a6f53e3.tar.gz
linux-3.10-44ef00e6482e755f36629773abc2aee83a6f53e3.tar.bz2
linux-3.10-44ef00e6482e755f36629773abc2aee83a6f53e3.zip
hp-wmi: Fix two memleaks
Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/platform/x86/hp-wmi.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index db10c5d007e..8781d8fa7a5 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -134,10 +134,15 @@ static int hp_wmi_perform_query(int query, int write, int value)
obj = output.pointer;
- if (!obj || obj->type != ACPI_TYPE_BUFFER)
+ if (!obj)
return -EINVAL;
+ else if (obj->type != ACPI_TYPE_BUFFER) {
+ kfree(obj);
+ return -EINVAL;
+ }
bios_return = *((struct bios_return *)obj->buffer.pointer);
+ kfree(obj);
if (bios_return.return_code > 0)
return bios_return.return_code * -1;
else
@@ -340,10 +345,12 @@ static void hp_wmi_notify(u32 value, void *context)
if (!obj || obj->type != ACPI_TYPE_BUFFER || obj->buffer.length != 8) {
printk(KERN_INFO "HP WMI: Unknown response received\n");
+ kfree(obj);
return;
}
eventcode = *((u8 *) obj->buffer.pointer);
+ kfree(obj);
if (eventcode == 0x4)
eventcode = hp_wmi_perform_query(HPWMI_HOTKEY_QUERY, 0,
0);