hp-wmi: Fix two memleaks

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
Thomas Renninger 2009-12-18 15:29:23 +01:00 committed by Len Brown
parent 4d5f177caf
commit 44ef00e648

View file

@ -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)
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);