diff options
author | Len Brown <len.brown@intel.com> | 2009-12-26 23:02:24 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-12-30 02:48:52 -0500 |
commit | fda11e61ff8a4e3a8ebbd434e46560b67cc0ca9d (patch) | |
tree | bfc911beea9c92888cafebe300740b92acc1b975 /drivers/platform/x86/hp-wmi.c | |
parent | f27725756be8a2c2dc65eaf70d0b52807aa2f113 (diff) |
dell-wmi, hp-wmi, msi-wmi: check wmi_get_event_data() return value
When acpi_evaluate_object() is passed ACPI_ALLOCATE_BUFFER,
the caller must kfree the returned buffer if AE_OK is returned.
The callers of wmi_get_event_data() pass ACPI_ALLOCATE_BUFFER,
and thus must check its return value before accessing
or kfree() on the buffer.
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/platform/x86/hp-wmi.c')
-rw-r--r-- | drivers/platform/x86/hp-wmi.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 18bf74136d24..5b648f0c6075 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c | |||
@@ -338,8 +338,13 @@ static void hp_wmi_notify(u32 value, void *context) | |||
338 | static struct key_entry *key; | 338 | static struct key_entry *key; |
339 | union acpi_object *obj; | 339 | union acpi_object *obj; |
340 | int eventcode; | 340 | int eventcode; |
341 | acpi_status status; | ||
341 | 342 | ||
342 | wmi_get_event_data(value, &response); | 343 | status = wmi_get_event_data(value, &response); |
344 | if (status != AE_OK) { | ||
345 | printk(KERN_INFO "hp-wmi: bad event status 0x%x\n", status); | ||
346 | return; | ||
347 | } | ||
343 | 348 | ||
344 | obj = (union acpi_object *)response.pointer; | 349 | obj = (union acpi_object *)response.pointer; |
345 | 350 | ||