sst-linux/drivers/thermal
Chenyuan Yang 6a810c462f thermal: int340x: Add NULL check for adev
[ Upstream commit 2542a3f70e563a9e70e7ded314286535a3321bdb ]

Not all devices have an ACPI companion fwnode, so adev might be NULL.
This is similar to the commit cd2fd6eab480
("platform/x86: int3472: Check for adev == NULL").

Add a check for adev not being set and return -ENODEV in that case to
avoid a possible NULL pointer deref in int3402_thermal_probe().

Note, under the same directory, int3400_thermal_probe() has such a
check.

Fixes: 77e337c6e2 ("Thermal: introduce INT3402 thermal driver")
Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/20250313043611.1212116-1-chenyuan0y@gmail.com
[ rjw: Subject edit, added Fixes: ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-04-10 14:33:31 +02:00
..
broadcom
intel thermal: int340x: Add NULL check for adev 2025-04-10 14:33:31 +02:00
qcom thermal/drivers/qcom/lmh: Remove false lockdep backtrace 2024-11-14 13:15:15 +01:00
samsung
st
tegra
ti-soc-thermal
amlogic_thermal.c
armada_thermal.c
cpufreq_cooling.c thermal/cpufreq_cooling: Remove structure member documentation 2025-03-28 21:58:51 +01:00
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
imx_thermal.c
k3_bandgap.c
k3_j72xx_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
rzg2l_thermal.c
spear_thermal.c
sprd_thermal.c
sun8i_thermal.c
thermal_core.c thermal: core: Initialize thermal zones before registering them 2024-12-14 19:53:17 +01:00
thermal_core.h
thermal_helpers.c
thermal_hwmon.c
thermal_hwmon.h
thermal_mmio.c
thermal_netlink.c
thermal_netlink.h
thermal_of.c thermal: of: fix OF node leak in of_thermal_zone_find() 2025-01-17 13:34:42 +01:00
thermal_sysfs.c
thermal-generic-adc.c
uniphier_thermal.c