Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git...
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / platform / x86 / wmi.c
index c10546c..a134c26 100644 (file)
@@ -755,9 +755,13 @@ static void wmi_free_devices(void)
        struct wmi_block *wblock, *next;
 
        /* Delete devices for all the GUIDs */
-       list_for_each_entry_safe(wblock, next, &wmi_block_list, list)
+       list_for_each_entry_safe(wblock, next, &wmi_block_list, list) {
+               list_del(&wblock->list);
                if (wblock->dev.class)
                        device_unregister(&wblock->dev);
+               else
+                       kfree(wblock);
+       }
 }
 
 static bool guid_already_parsed(const char *guid_string)