aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);