Re: [PATCH] platform/x86: int3472: Fix double free of GPIO device during unregister

From: Andy Shevchenko
Date: Fri Oct 24 2025 - 02:15:46 EST


On Fri, Oct 24, 2025 at 01:05:37PM +0800, Qiu Wenbo wrote:
>
> regulator_unregister() already frees the associated GPIO device. On
> ThinkPad X9 (Lunar Lake), this causes a double free issue that leads to
> random failures when other drivers (typically Intel THC) attempt to
> allocate interrupts. The root cause is that the reference count of the
> pinctrl_intel_platform module unexpectedly drops to zero when this
> driver defers its probe.
>
> This behavior can also be reproduced by unloading the module directly.
>
> Fix the issue by removing the redundant release of the GPIO device
> during regulator unregistration.
>
> Fixes: 1e5d088a52c2 ("platform/x86: int3472: Stop using devm_gpiod_get()")

>

Should not be a blank line here.

> Signed-off-by: Qiu Wenbo <qiuwenbo@xxxxxxxxxxxxxxx>
> ---

The change sounds reasonable to me. FWIW,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>

--
With Best Regards,
Andy Shevchenko