diff options
| author | Danilo Krummrich <dakr@kernel.org> | 2026-05-26 03:04:41 +0300 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2026-05-29 02:06:10 +0300 |
| commit | 016267b521b18529c977c9eca9597a1669c3d73c (patch) | |
| tree | 3c5f634a2f0c9e7390c7277c29af7c8dcaa3da6f /include/linux/timerqueue.h | |
| parent | 2c7c65933600e8db2ec1a78dec5008de876dd3ad (diff) | |
| download | linux-016267b521b18529c977c9eca9597a1669c3d73c.tar.xz | |
rust: devres: add 'static bound to Devres<T>
Devres::new() registers a callback with the C devres subsystem via
devres_node_add(). If the Devres is leaked (e.g. via
core::mem::forget(), which is safe), its Drop impl never runs, and the
devres release callback will revoke the inner Revocable on device
unbind, which drops T in place. If T contains non-'static references,
those may be dangling by that point.
Add a 'static bound to prevent storing types with borrowed data in
Devres.
Fixes: 76c01ded724b ("rust: add devres abstraction")
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>
Link: https://patch.msgid.link/20260526000447.350558-1-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions
