diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-01-04 16:45:56 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-01-04 16:45:56 +0900 |
commit | 921a220857cdd3c553cde7c114f9f6757ac80cd5 (patch) | |
tree | 526610397dfb83d72c43c94300deea23d26e782a /drivers/platform/x86/hp-wmi.c | |
parent | 17eb9d62828c3688f41f31ac00d7fee6da9675bf (diff) | |
parent | 2f48912d1443a796f10c42c89cb386f0e3eca04d (diff) |
Merge branch 'sh/stable-updates'
Diffstat (limited to 'drivers/platform/x86/hp-wmi.c')
-rw-r--r-- | drivers/platform/x86/hp-wmi.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 63c3e658a884..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) 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); @@ -381,6 +388,8 @@ static void hp_wmi_notify(u32 value, void *context) } else printk(KERN_INFO "HP WMI: Unknown key pressed - %x\n", eventcode); + + kfree(obj); } static int __init hp_wmi_input_setup(void) |