]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/thermal/thermal_core.c
thermal: Fix deadlock in thermal thermal_zone_device_check
[mirror_ubuntu-bionic-kernel.git] / drivers / thermal / thermal_core.c
index 456ef213dc14103f2293a80a0d1cf6d48411afb9..fcefafe7df4849b1b9e0034fb4dc34fa412f9f45 100644 (file)
@@ -299,7 +299,7 @@ static void thermal_zone_device_set_polling(struct thermal_zone_device *tz,
                mod_delayed_work(system_freezable_wq, &tz->poll_queue,
                                 msecs_to_jiffies(delay));
        else
-               cancel_delayed_work_sync(&tz->poll_queue);
+               cancel_delayed_work(&tz->poll_queue);
 }
 
 static void monitor_thermal_zone(struct thermal_zone_device *tz)
@@ -1350,7 +1350,7 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz)
 
        mutex_unlock(&thermal_list_lock);
 
-       thermal_zone_device_set_polling(tz, 0);
+       cancel_delayed_work_sync(&tz->poll_queue);
 
        thermal_set_governor(tz, NULL);