]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
thermal: core: Free thermal zone ID later during removal
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 7 Apr 2026 13:58:34 +0000 (15:58 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 8 Apr 2026 10:30:30 +0000 (12:30 +0200)
commitdaae9c18feec74566e023fc88cfb0ce26e39d868
treeae49cc1c4b2702660a34ffe9b96078152a8c3908
parent41ff66baf81c6541f4f985dd7eac4494d03d9440
thermal: core: Free thermal zone ID later during removal

The thermal zone removal ordering is different from the thermal zone
registration rollback path ordering and the former is arguably
problematic because freeing a thermal zone ID prematurely may cause
it to be used during the registration of another thermal zone which
may fail as a result.

Prevent that from occurring by changing the thermal zone removal
ordering to reflect the thermal zone registration rollback path
ordering.

Also more the ida_destroy() call from thermal_zone_device_unregister()
to thermal_release() for consistency.

Fixes: b31ef8285b19 ("thermal core: convert ID allocation to IDA")
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/5063934.GXAFRqVoOG@rafael.j.wysocki
drivers/thermal/thermal_core.c