]> git.ipfire.org Git - thirdparty/linux.git/commit
rust: devres: remove action in `Devres::drop`
authorDanilo Krummrich <dakr@kernel.org>
Tue, 7 Jan 2025 12:25:11 +0000 (13:25 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Jan 2025 14:49:06 +0000 (15:49 +0100)
commit8ff656643d3075154419680470dbfdbd6092e31f
treeec7bfd6b8c8ab367c6feacdea717dbb8e1c6e1bd
parentf1725160fd28a2e65e47166637aa44856a1a7f89
rust: devres: remove action in `Devres::drop`

So far `DevresInner` is kept alive, even if `Devres` is dropped until
the devres callback is executed to avoid a WARN() when the action has
been released already.

With the introduction of devm_remove_action_nowarn() we can remove the
action in `Devres::drop`, handle the case where the action has been
released already and hence also free `DevresInner`.

Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/20250107122609.8135-2-dakr@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
rust/kernel/devres.rs