rust: devres: fix leaking call to devm_add_action()
When the data argument of Devres::new() is Err(), we leak the preceding call to devm_add_action(). In order to fix this, call devm_add_action() in a unit type initializer in try_pin_init!() after the initializers of all other fields. Fixes: f5d3ef25 ("rust: devres: get rid of Devres' inner Arc") Reviewed-by:Alice Ryhl <aliceryhl@google.com> Reviewed-by:
Benno Lossin <lossin@kernel.org> Link: https://lore.kernel.org/r/20250812130928.11075-1-dakr@kernel.org Signed-off-by:
Danilo Krummrich <dakr@kernel.org>
Loading
Please sign in to comment