sst-linux/drivers/thermal/intel
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
..
int340x_thermal thermal: int340x: Add NULL check for adev 2025-04-10 14:33:31 +02:00
intel_bxt_pmic_thermal.c
intel_hfi.c
intel_hfi.h
intel_menlow.c
intel_pch_thermal.c
intel_powerclamp.c
intel_quark_dts_thermal.c
intel_soc_dts_iosf.c
intel_soc_dts_iosf.h
intel_soc_dts_thermal.c
intel_tcc_cooling.c
Kconfig
Makefile
therm_throt.c
thermal_interrupt.h
x86_pkg_temp_thermal.c