Re: [PATCH v2] rust: devres: fix leaking call to devm_add_action()
From: Danilo Krummrich
Date: Wed Aug 13 2025 - 20:03:57 EST
On Tue Aug 12, 2025 at 3:09 PM CEST, Danilo Krummrich wrote:
> 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: f5d3ef25d238 ("rust: devres: get rid of Devres' inner Arc")
> Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx>
Applied to driver-core-linus, thanks!