Re: [PATCH] i2c: acpi: Fix adapter reference leak in i2c_acpi_new_device_by_fwnode()

From: Mika Westerberg

Date: Thu Sep 17 2026 - 02:58:14 EST


Hi,

On Wed, Sep 16, 2026 at 03:55:07PM +0000, Wentao Liang wrote:
> i2c_acpi_find_adapter_by_handle() returns the adapter with a reference
> obtained via get_device() in bus_find_device(), which the caller is
> responsible for dropping. i2c_new_client_device() stores the adapter
> pointer without taking a reference and does not release the caller's
> reference on any path, so the reference is leaked.
>
> Drop the adapter device reference after creating the client, like
> i2c_acpi_notify() does.
>
> Fixes: 53f8f7c5cf14 ("i2c: break out ACPI support into separate file")

I don't think this is right. The issue existed already before the move.

> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>

Acked-by: Mika Westerberg <westeri@xxxxxxxxxx>