Advertisement
vliaskov

lock device_hotplug before checking cpu_online mask

Jul 3rd, 2017
84
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ---
  2. drivers/xen/cpu_hotplug.c | 7 +++----
  3. 1 file changed, 3 insertions(+), 4 deletions(-)
  4.  
  5. diff --git a/drivers/xen/cpu_hotplug.c b/drivers/xen/cpu_hotplug.c
  6. index 5676aef..ee26cd9 100644
  7. --- a/drivers/xen/cpu_hotplug.c
  8. +++ b/drivers/xen/cpu_hotplug.c
  9. @@ -18,11 +18,10 @@ static void enable_hotplug_cpu(int cpu)
  10.  
  11. static void disable_hotplug_cpu(int cpu)
  12. {
  13. - if (cpu_online(cpu)) {
  14. - lock_device_hotplug();
  15. + lock_device_hotplug();
  16. + if (cpu_online(cpu))
  17. device_offline(get_cpu_device(cpu));
  18. - unlock_device_hotplug();
  19. - }
  20. + unlock_device_hotplug();
  21. if (cpu_present(cpu))
  22. xen_arch_unregister_cpu(cpu);
  23.  
  24. --
  25. 1.7.12.4
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement