linux/drivers/thermal
Ahmad Fatoum ac4436a5b2 thermal: of: fix double-free on unregistration
Since commit 3d439b1a2a ("thermal/core: Alloc-copy-free the thermal
zone parameters structure"), thermal_zone_device_register() allocates
a copy of the tzp argument and frees it when unregistering, so
thermal_of_zone_register() now ends up leaking its original tzp and
double-freeing the tzp copy. Fix this by locating tzp on stack instead.

Fixes: 3d439b1a2a ("thermal/core: Alloc-copy-free the thermal zone parameters structure")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: 6.4+ <stable@vger.kernel.org> # 6.4+: 8bcbb18c61d6: thermal: core: constify params in thermal_zone_device_register
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2023-07-24 09:51:31 +02:00
..
broadcom thermal/drivers/bcm2835: Remove buggy call to thermal_of_zone_unregister 2023-04-07 18:36:28 +02:00
intel Thermal control updates for 6.5-rc1 2023-06-26 19:41:26 -07:00
mediatek thermal/drivers/mediatek/lvts_thermal: Remove redundant msg in lvts_ctrl_start() 2023-06-26 12:03:14 +02:00
qcom thermal/drivers/qcom/temp-alarm: Use dev_err_probe 2023-06-26 12:10:22 +02:00
samsung thermal/core: Use the thermal zone 'devdata' accessor in thermal located drivers 2023-03-03 20:45:02 +01:00
st thermal/drivers/stm32: Convert to platform remove callback returning void 2023-06-26 12:03:14 +02:00
tegra thermal/drivers/tegra: Remove redundant msg in tegra_tsensor_register_channel() 2023-06-26 12:03:14 +02:00
ti-soc-thermal thermal/drivers/ti-soc: Remove redundant msg in ti_thermal_expose_sensor() 2023-06-26 12:03:14 +02:00
amlogic_thermal.c thermal/drivers/amlogic: Remove redundant msg in amlogic_thermal_probe() 2023-06-26 12:03:14 +02:00
armada_thermal.c thermal/drivers/armada: Add support for AP807 thermal data 2023-06-26 12:03:14 +02:00
cpufreq_cooling.c - Add more thermal zone device encapsulation: prevent setting 2023-04-03 20:43:32 +02:00
cpuidle_cooling.c More thermal control updates for 6.4-rc1 2023-05-03 11:46:01 -07:00
da9062-thermal.c thermal/drivers/da9062: Don't access the thermal zone device fields 2023-03-03 20:45:03 +01:00
db8500_thermal.c thermal/drivers/db8500: Use driver dev instead of tz->device 2023-04-01 20:51:45 +02:00
devfreq_cooling.c thermal/core: Relocate the traces definition in thermal directory 2023-04-01 20:51:45 +02:00
dove_thermal.c thermal: Remove debug or error messages in get_temp() ops 2023-03-03 20:45:02 +01:00
gov_bang_bang.c thermal/core/governors: Use thermal_zone_get_trip() instead of ops functions 2023-01-06 14:14:47 +01:00
gov_fair_share.c thermal/core: Relocate the traces definition in thermal directory 2023-04-01 20:51:45 +02:00
gov_power_allocator.c thermal/core: Relocate the traces definition in thermal directory 2023-04-01 20:51:45 +02:00
gov_step_wise.c thermal: gov_step_wise: Adjust code logic to match comment 2023-04-27 19:17:11 +02:00
gov_user_space.c thermal: gov_user_space: Do not lock thermal zone mutex 2022-08-30 20:18:47 +02:00
hisi_thermal.c thermal/drivers/hisi: Use devm_platform_ioremap_resource() 2023-04-01 20:51:45 +02:00
imx8mm_thermal.c thermal/drivers/imx: Remove redundant msg in imx8mm_tmu_probe() and imx_sc_thermal_probe() 2023-06-26 12:03:14 +02:00
imx_sc_thermal.c thermal/drivers/imx: Remove redundant msg in imx8mm_tmu_probe() and imx_sc_thermal_probe() 2023-06-26 12:03:14 +02:00
imx_thermal.c - Add more thermal zone device encapsulation: prevent setting 2023-04-03 20:43:32 +02:00
k3_bandgap.c drivers/thermal/k3: Remove redundant msg in k3_bandgap_probe() 2023-06-26 12:03:14 +02:00
k3_j72xx_bandgap.c thermal/core: Use the thermal zone 'devdata' accessor in thermal located drivers 2023-03-03 20:45:02 +01:00
Kconfig thermal: Allow selecting the bang-bang governor as default 2023-06-26 12:03:13 +02:00
khadas_mcu_fan.c
kirkwood_thermal.c thermal: Remove debug or error messages in get_temp() ops 2023-03-03 20:45:02 +01:00
Makefile thermal/core: Relocate the traces definition in thermal directory 2023-04-01 20:51:45 +02:00
max77620_thermal.c thermal: Remove debug or error messages in get_temp() ops 2023-03-03 20:45:02 +01:00
qoriq_thermal.c thermal/drivers/qoriq: Remove redundant msg in qoriq_tmu_register_tmu_zone() 2023-06-26 12:03:14 +02:00
rcar_gen3_thermal.c drivers/thermal/rcar_gen3_thermal: add reading fuses for Gen4 2023-06-26 12:03:13 +02:00
rcar_thermal.c thermal/hwmon: Do not set no_hwmon before calling thermal_add_hwmon_sysfs() 2023-03-03 20:45:02 +01:00
rockchip_thermal.c thermal/drivers/rockchip: use devm_reset_control_array_get_exclusive() 2023-04-07 10:31:33 +02:00
rzg2l_thermal.c thermal/hwmon: Do not set no_hwmon before calling thermal_add_hwmon_sysfs() 2023-03-03 20:45:02 +01:00
spear_thermal.c thermal/drivers/spear: Don't use tz->device but pdev->dev 2023-03-03 20:45:02 +01:00
sprd_thermal.c thermal/core: Use the thermal zone 'devdata' accessor in thermal located drivers 2023-03-03 20:45:02 +01:00
sun8i_thermal.c thermal/drivers/sun8i: Remove redundant msg in sun8i_ths_register() 2023-06-26 12:03:14 +02:00
thermal_acpi.c thermal: ACPI: Make helpers retrieve temperature only 2023-02-02 15:26:45 +01:00
thermal_core.c thermal: core: constify params in thermal_zone_device_register 2023-07-24 09:51:31 +02:00
thermal_core.h thermal: Allow selecting the bang-bang governor as default 2023-06-26 12:03:13 +02:00
thermal_helpers.c thermal/core: Relocate the traces definition in thermal directory 2023-04-01 20:51:45 +02:00
thermal_hwmon.c thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs() 2023-06-26 12:03:14 +02:00
thermal_hwmon.h thermal/hwmon: Use the right device for devm_thermal_add_hwmon_sysfs() 2023-03-03 20:45:02 +01:00
thermal_mmio.c thermal/core: Use the thermal zone 'devdata' accessor in thermal located drivers 2023-03-03 20:45:02 +01:00
thermal_netlink.c thermal/core: Fix unregistering netlink at thermal init time 2023-01-25 16:40:39 +01:00
thermal_netlink.h thermal/core: Fix unregistering netlink at thermal init time 2023-01-25 16:40:39 +01:00
thermal_of.c thermal: of: fix double-free on unregistration 2023-07-24 09:51:31 +02:00
thermal_sysfs.c thermal: core: Drop excessive lockdep_assert_held() calls 2023-03-28 20:49:47 +02:00
thermal_trace_ipa.h thermal/core: Relocate the traces definition in thermal directory 2023-04-01 20:51:45 +02:00
thermal_trace.h thermal/core: Relocate the traces definition in thermal directory 2023-04-01 20:51:45 +02:00
thermal_trip.c thermal/core: Move the thermal trip code to a dedicated file 2023-01-25 16:40:39 +01:00
thermal-generic-adc.c thermal/drivers/generic-adc: Register thermal zones as hwmon sensors 2023-06-26 12:03:14 +02:00
uniphier_thermal.c thermal/core: Use the thermal zone 'devdata' accessor in thermal located drivers 2023-03-03 20:45:02 +01:00