Re: [PATCH v3 08/10] i2c: core: fix adapter deregistration race
From: Wolfram Sang
Date: Thu Jun 04 2026 - 05:07:32 EST
On Mon, May 11, 2026 at 04:37:13PM +0200, Johan Hovold wrote:
> Adapters can be looked up by their id using i2c_get_adapter() which
> takes a reference to the embedded struct device.
>
> Remove the adapter from the IDR before tearing it down during
> deregistration (and on registration failure) to make sure its resources
> are not accessed after having been freed (e.g. the device name).
>
> Fixes: 35fc37f81881 ("i2c: Limit core locking to the necessary sections")
> Cc: stable@xxxxxxxxxxxxxxx # 2.6.31
> Cc: Jean Delvare <khali@xxxxxxxxxxxx>
> Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
Reviewed-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
Attachment:
signature.asc
Description: PGP signature