aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2009-12-18 09:29:23 -0500
committerLen Brown <len.brown@intel.com>2009-12-24 00:54:49 -0500
commit44ef00e6482e755f36629773abc2aee83a6f53e3 (patch)
tree6552ee01bf2c1aa9c461df7cc1823a94899610ba /drivers/platform/x86
parent4d5f177caf1ef78f5e7eaee75b66b4d534445682 (diff)
hp-wmi: Fix two memleaks
Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/platform/x86')
-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 db10c5d007ec..8781d8fa7a57 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)
134 134
135 obj = output.pointer; 135 obj = output.pointer;
136 136
137 if (!obj || obj->type != ACPI_TYPE_BUFFER) 137 if (!obj)
138 return -EINVAL; 138 return -EINVAL;
139 else if (obj->type != ACPI_TYPE_BUFFER) {
140 kfree(obj);
141 return -EINVAL;
142 }
139 143
140 bios_return = *((struct bios_return *)obj->buffer.pointer); 144 bios_return = *((struct bios_return *)obj->buffer.pointer);
145 kfree(obj);
141 if (bios_return.return_code > 0) 146 if (bios_return.return_code > 0)
142 return bios_return.return_code * -1; 147 return bios_return.return_code * -1;
143 else 148 else
@@ -340,10 +345,12 @@ static void hp_wmi_notify(u32 value, void *context)
340 345
341 if (!obj || obj->type != ACPI_TYPE_BUFFER || obj->buffer.length != 8) { 346 if (!obj || obj->type != ACPI_TYPE_BUFFER || obj->buffer.length != 8) {
342 printk(KERN_INFO "HP WMI: Unknown response received\n"); 347 printk(KERN_INFO "HP WMI: Unknown response received\n");
348 kfree(obj);
343 return; 349 return;
344 } 350 }
345 351
346 eventcode = *((u8 *) obj->buffer.pointer); 352 eventcode = *((u8 *) obj->buffer.pointer);
353 kfree(obj);
347 if (eventcode == 0x4) 354 if (eventcode == 0x4)
348 eventcode = hp_wmi_perform_query(HPWMI_HOTKEY_QUERY, 0, 355 eventcode = hp_wmi_perform_query(HPWMI_HOTKEY_QUERY, 0,
349 0); 356 0);