thermal/debugfs: Free all thermal zone debug memory on zone removal
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 25 Apr 2024 17:52:12 +0000 (19:52 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 26 Apr 2024 09:11:00 +0000 (11:11 +0200)
commit72c1afffa4c645fe0e0f1c03e5f34395ed65b5f4
treefd917dc4b67e8f3c5d8b100a2b16ef91a6bf62c7
parented30a4a51bb196781c8058073ea720133a65596f
thermal/debugfs: Free all thermal zone debug memory on zone removal

Because thermal_debug_tz_remove() does not free all memory allocated for
thermal zone diagnostics, some of that memory becomes unreachable after
freeing the thermal zone's struct thermal_debugfs object.

Address this by making thermal_debug_tz_remove() free all of the memory
in question.

Fixes: 7ef01f228c9f ("thermal/debugfs: Add thermal debugfs information for mitigation episodes")
Cc :6.8+ <stable@vger.kernel.org> # 6.8+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
drivers/thermal/thermal_debugfs.c