wmi: Free the allocated acpi objects through wmi_get_event_data
authorAnisse Astier <anisse@astier.eu>
Fri, 4 Dec 2009 09:10:09 +0000 (10:10 +0100)
committerLen Brown <len.brown@intel.com>
Thu, 24 Dec 2009 05:42:00 +0000 (00:42 -0500)
These function allocate an acpi object by calling wmi_get_event_data, which
then calls acpi_evaluate_object, and it is not freed afterwards.

And kernel doc is fixed for parameters of wmi_get_event_data.

Signed-off-by: Anisse Astier <anisse@astier.eu>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/platform/x86/dell-wmi.c
drivers/platform/x86/hp-wmi.c
drivers/platform/x86/wmi.c

index 67f3fe71c509e2f1e6ceab0646507087aa888eca..6561dfc028e56211d4dcc3cb66c0fb2cd4ccdf7e 100644 (file)
@@ -238,6 +238,7 @@ static void dell_wmi_notify(u32 value, void *context)
                        input_sync(dell_wmi_input_dev);
                }
        }
+       kfree(obj);
 }
 
 
index 63c3e658a884e3f0d46b3f076e91862b3471b8b6..db10c5d007ec2f1953638144a87d09adc70a0c7d 100644 (file)
@@ -381,6 +381,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)
index e425a868cd3ad295063badaf90195fc57146b547..9f93d6c0f510d88a9e662caa917e92df4a4ed39f 100644 (file)
@@ -540,8 +540,8 @@ EXPORT_SYMBOL_GPL(wmi_remove_notify_handler);
 /**
  * wmi_get_event_data - Get WMI data associated with an event
  *
- * @event - Event to find
- * &out - Buffer to hold event data
+ * @event: Event to find
+ * @out: Buffer to hold event data. out->pointer should be freed with kfree()
  *
  * Returns extra data associated with an event in WMI.
  */