Commit 44ef00e6 authored by Thomas Renninger's avatar Thomas Renninger Committed by Len Brown

hp-wmi: Fix two memleaks

Signed-off-by: default avatarThomas Renninger <trenn@suse.de>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 4d5f177c
...@@ -134,10 +134,15 @@ static int hp_wmi_perform_query(int query, int write, int value) ...@@ -134,10 +134,15 @@ static int hp_wmi_perform_query(int query, int write, int value)
obj = output.pointer; obj = output.pointer;
if (!obj || obj->type != ACPI_TYPE_BUFFER) if (!obj)
return -EINVAL; return -EINVAL;
else if (obj->type != ACPI_TYPE_BUFFER) {
kfree(obj);
return -EINVAL;
}
bios_return = *((struct bios_return *)obj->buffer.pointer); bios_return = *((struct bios_return *)obj->buffer.pointer);
kfree(obj);
if (bios_return.return_code > 0) if (bios_return.return_code > 0)
return bios_return.return_code * -1; return bios_return.return_code * -1;
else else
...@@ -340,10 +345,12 @@ static void hp_wmi_notify(u32 value, void *context) ...@@ -340,10 +345,12 @@ static void hp_wmi_notify(u32 value, void *context)
if (!obj || obj->type != ACPI_TYPE_BUFFER || obj->buffer.length != 8) { if (!obj || obj->type != ACPI_TYPE_BUFFER || obj->buffer.length != 8) {
printk(KERN_INFO "HP WMI: Unknown response received\n"); printk(KERN_INFO "HP WMI: Unknown response received\n");
kfree(obj);
return; return;
} }
eventcode = *((u8 *) obj->buffer.pointer); eventcode = *((u8 *) obj->buffer.pointer);
kfree(obj);
if (eventcode == 0x4) if (eventcode == 0x4)
eventcode = hp_wmi_perform_query(HPWMI_HOTKEY_QUERY, 0, eventcode = hp_wmi_perform_query(HPWMI_HOTKEY_QUERY, 0,
0); 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment