Re: [PATCH] thermal: int340x: Add Null check for adev
From: Uwe Kleine-König
Date: Thu Mar 13 2025 - 04:37:16 EST
Hello,
On Wed, Mar 12, 2025 at 11:36:11PM -0500, Chenyuan Yang wrote:
> 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.
>
> Signed-off-by: Chenyuan Yang <chenyuan0y@xxxxxxxxx>
Acked-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxx>
Fixes: 77e337c6e23e ("Thermal: introduce INT3402 thermal driver")
Best regards
Uwe
Attachment:
signature.asc
Description: PGP signature