浏览代码

[PATCH] x86-64: Fix kobject_init() WARN_ON on resume from disk

Make mce_remove_device() clean up the kobject in per_cpu(device_mce, cpu)
after it has been unregistered.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Andi Kleen <ak@suse.de>
Rafael J. Wysocki 18 年之前
父节点
当前提交
d4c45718b3
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      arch/x86_64/kernel/mce.c

+ 1 - 0
arch/x86_64/kernel/mce.c

@@ -652,6 +652,7 @@ static void mce_remove_device(unsigned int cpu)
 	sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_tolerant);
 	sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_tolerant);
 	sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_check_interval);
 	sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_check_interval);
 	sysdev_unregister(&per_cpu(device_mce,cpu));
 	sysdev_unregister(&per_cpu(device_mce,cpu));
+	memset(&per_cpu(device_mce, cpu).kobj, 0, sizeof(struct kobject));
 }
 }
 
 
 /* Get notified when a cpu comes on/off. Be hotplug friendly. */
 /* Get notified when a cpu comes on/off. Be hotplug friendly. */