On Tue, Nov 10, 2026 at 09:51:18AM +0100, Johan Hovold wrote: > If a client has both a primary and a secondary firmware node, the > secondary node is accessed via the ->secondary pointer of the primary > node. > > Use a temporary variable to track whether the firmware node is a > software node and remove any software node before dropping its reference > to avoid a use-after-free in device_remove_software_node() when > accessing the secondary firmware node. > > Fixes: df6d7277e552 ("i2c: core: Do not dereference fwnode in struct device") > Fixes: 1c24e5fc0c70 ("i2c: core: Fix double-free of fwnode in i2c_unregister_device()") > Cc: stable@vger.kernel.org # 6.16 > Cc: Andy Shevchenko > Cc: Hans de Goede > Signed-off-by: Johan Hovold Looks reasonable to me. Thanks for doing this and the cleanup in patch 4/8. Acked-by: Wolfram Sang