anolis-cloud-kernel/drivers/thermal
Rafael J. Wysocki 87850f4dcc thermal: sysfs: Fix cooling_device_stats_setup() error code path
ANBZ: #9534

commit d5a8aa5d7d upstream.

If cooling_device_stats_setup() fails to create the stats object, it
must clear the last slot in cooling_device_attr_groups that was
initially empty (so as to make it possible to add stats attributes to
the cooling device attribute groups).

Failing to do so may cause the stats attributes to be created by
mistake for a device that doesn't have a stats object, because the
slot in question might be populated previously during the registration
of another cooling device.

Fixes: 8ea229511e ("thermal: Add cooling device's statistics in sysfs")
Reported-by: Di Shen <di.shen@unisoc.com>
Tested-by: Di Shen <di.shen@unisoc.com>
Cc: 4.17+ <stable@vger.kernel.org> # 4.17+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Kun(llfl) <llfl@linux.alibaba.com>
Reviewed-by: Artie Ding <artie.ding@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/3497
2024-07-18 03:51:51 +00:00
..
broadcom thermal/drivers/broadcom: Fix potential NULL dereference in sr_thermal_probe 2022-06-09 10:21:11 +02:00
intel thermal: intel: powerclamp: Fix cur_state for multi package system 2024-07-18 03:51:51 +00:00
qcom
samsung
st
tegra
ti-soc-thermal
Kconfig
Makefile
amlogic_thermal.c
armada_thermal.c
cpufreq_cooling.c
cpuidle_cooling.c
da9062-thermal.c
db8500_thermal.c
devfreq_cooling.c
dove_thermal.c
gov_bang_bang.c
gov_fair_share.c
gov_power_allocator.c
gov_step_wise.c
gov_user_space.c
hisi_thermal.c
imx8mm_thermal.c
imx_sc_thermal.c thermal/drivers/imx_sc_thermal: Fix refcount leak in imx_sc_thermal_probe 2022-06-09 10:21:11 +02:00
imx_thermal.c
k3_bandgap.c
khadas_mcu_fan.c
kirkwood_thermal.c
max77620_thermal.c
mtk_thermal.c
qoriq_thermal.c
rcar_gen3_thermal.c
rcar_thermal.c
rockchip_thermal.c
spear_thermal.c
sprd_thermal.c
sun8i_thermal.c
tango_thermal.c
thermal-generic-adc.c
thermal_core.c thermal: core: prevent potential string overflow 2024-07-18 03:51:51 +00:00
thermal_core.h
thermal_helpers.c
thermal_hwmon.c
thermal_hwmon.h
thermal_mmio.c
thermal_netlink.c thermal: netlink: Add a new event to notify CPU capabilities change 2022-08-02 16:44:29 +08:00
thermal_netlink.h thermal: netlink: Fix parameter type of thermal_genl_cpu_capability_event() stub 2022-08-02 16:44:31 +08:00
thermal_of.c
thermal_sysfs.c thermal: sysfs: Fix cooling_device_stats_setup() error code path 2024-07-18 03:51:51 +00:00
uniphier_thermal.c
zx2967_thermal.c