kernel_optimize_test/drivers/thermal
Daniel Lezcano 54cdc10ac7 thermal/core: Fix memory leak in the error path
commit d44616c6cc3e35eea03ecfe9040edfa2b486a059 upstream.

Fix the following error:

 smatch warnings:
 drivers/thermal/thermal_core.c:1020 __thermal_cooling_device_register() warn: possible memory leak of 'cdev'

by freeing the cdev when exiting the function in the error path.

Fixes: 584837618100 ("thermal/drivers/core: Use a char pointer for the cooling device name")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210319202257.890848-1-daniel.lezcano@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-09 10:21:30 +02:00
..
broadcom thermal/drivers/broadcom: Fix potential NULL dereference in sr_thermal_probe 2022-06-09 10:21:11 +02:00
intel thermal: int340x: Fix attr.show callback prototype 2022-05-09 09:05:07 +02:00
qcom
samsung
st
tegra
ti-soc-thermal
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
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
imx8mm_thermal.c
k3_bandgap.c
Kconfig
khadas_mcu_fan.c
kirkwood_thermal.c
Makefile
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_core.c thermal/core: Fix memory leak in the error path 2022-06-09 10:21:30 +02:00
thermal_core.h
thermal_helpers.c
thermal_hwmon.c
thermal_hwmon.h
thermal_mmio.c
thermal_netlink.c thermal: core: Fix TZ_GET_TRIP NULL pointer dereference 2022-03-08 19:09:32 +01:00
thermal_netlink.h
thermal_of.c
thermal_sysfs.c
thermal-generic-adc.c
uniphier_thermal.c
zx2967_thermal.c