dell-wmi: Fix memory leak
authorYong Wang <yong.y.wang@linux.intel.com>
Mon, 5 Apr 2010 13:09:40 +0000 (21:09 +0800)
committerMatthew Garrett <mjg@redhat.com>
Mon, 12 Apr 2010 17:10:19 +0000 (13:10 -0400)
The output of wmi_get_event_data shall be freed before return.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Yong Wang <yong.y.wang@linux.intel.com>
drivers/platform/x86/dell-wmi.c

index 6ba6c30e5bb67723ae27f421795af51a1f8e0857..66f53c3c35e8bf3fef464b2c8fae431167bca464 100644 (file)
@@ -217,6 +217,7 @@ static void dell_wmi_notify(u32 value, void *context)
                if (dell_new_hk_type && (buffer_entry[1] != 0x10)) {
                        printk(KERN_INFO "dell-wmi: Received unknown WMI event"
                                         " (0x%x)\n", buffer_entry[1]);
+                       kfree(obj);
                        return;
                }
 
@@ -234,7 +235,7 @@ static void dell_wmi_notify(u32 value, void *context)
                            key->keycode == KEY_BRIGHTNESSDOWN) && acpi_video) {
                        /* Don't report brightness notifications that will also
                         * come via ACPI */
-                       return;
+                       ;
                } else {
                        input_report_key(dell_wmi_input_dev, key->keycode, 1);
                        input_sync(dell_wmi_input_dev);