Commit 6a810c46 authored by Chenyuan Yang's avatar Chenyuan Yang Committed by Greg Kroah-Hartman
Browse files

thermal: int340x: Add NULL check for adev



[ Upstream commit 2542a3f7 ]

Not all devices have an ACPI companion fwnode, so adev might be NULL.
This is similar to the commit cd2fd6ea
("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: 77e337c6 ("Thermal: introduce INT3402 thermal driver")
Signed-off-by: default avatarChenyuan Yang <chenyuan0y@gmail.com>
Acked-by: default avatarUwe 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: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 0e44e887
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment