Skip to content

Commit d547d44

Browse files
committed
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Pull thermal management updates from Zhang Rui: - Fix a use-after-free issue when unregistering a thermal cooling device (Dmitry Osipenko) - use power_efficient_wq for thermal worker to save more power (Jeson Gao) * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: thermal: core: using power_efficient_wq for thermal worker thermal: core: Fix use-after-free in thermal_cooling_device_destroy_sysfs
2 parents 519f64b + c2b59d2 commit d547d44

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/thermal/thermal_core.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,12 @@ static void thermal_zone_device_set_polling(struct thermal_zone_device *tz,
290290
int delay)
291291
{
292292
if (delay > 1000)
293-
mod_delayed_work(system_freezable_wq, &tz->poll_queue,
293+
mod_delayed_work(system_freezable_power_efficient_wq,
294+
&tz->poll_queue,
294295
round_jiffies(msecs_to_jiffies(delay)));
295296
else if (delay)
296-
mod_delayed_work(system_freezable_wq, &tz->poll_queue,
297+
mod_delayed_work(system_freezable_power_efficient_wq,
298+
&tz->poll_queue,
297299
msecs_to_jiffies(delay));
298300
else
299301
cancel_delayed_work(&tz->poll_queue);
@@ -1102,8 +1104,9 @@ void thermal_cooling_device_unregister(struct thermal_cooling_device *cdev)
11021104
mutex_unlock(&thermal_list_lock);
11031105

11041106
ida_simple_remove(&thermal_cdev_ida, cdev->id);
1105-
device_unregister(&cdev->device);
1107+
device_del(&cdev->device);
11061108
thermal_cooling_device_destroy_sysfs(cdev);
1109+
put_device(&cdev->device);
11071110
}
11081111
EXPORT_SYMBOL_GPL(thermal_cooling_device_unregister);
11091112

0 commit comments

Comments
 (0)