msi-wmi: Fix memory leak
authorMaxim Mikityanskiy <maxtram95@gmail.com>
Sat, 15 Dec 2012 17:31:31 +0000 (19:31 +0200)
committerMatthew Garrett <matthew.garrett@nebula.com>
Sun, 24 Feb 2013 22:49:54 +0000 (14:49 -0800)
Fix memory leak - don't forget to kfree ACPI object when returning from
msi_wmi_notify() after suppressing key event.

Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Acked-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
drivers/platform/x86/msi-wmi.c

index 2264331bd48e22b1178e64f87f861188a9104304..b96766b61ea3b5780f2dabb31ccae9c03d9ef6d2 100644 (file)
@@ -176,7 +176,7 @@ static void msi_wmi_notify(u32 value, void *context)
                                pr_debug("Suppressed key event 0x%X - "
                                         "Last press was %lld us ago\n",
                                         key->code, ktime_to_us(diff));
-                               return;
+                               goto msi_wmi_notify_exit;
                        }
                        last_pressed[key->code - SCANCODE_BASE] = cur;
 
@@ -195,6 +195,8 @@ static void msi_wmi_notify(u32 value, void *context)
                        pr_info("Unknown key pressed - %x\n", eventcode);
        } else
                pr_info("Unknown event received\n");
+
+msi_wmi_notify_exit:
        kfree(response.pointer);
 }