diff options
author | Danilo Krummrich <dakr@kernel.org> | 2025-06-29 18:37:42 +0300 |
---|---|---|
committer | Danilo Krummrich <dakr@kernel.org> | 2025-07-04 01:33:56 +0300 |
commit | 2e9fdbe5ec7a65b66da9c202cac621a3a366fde3 (patch) | |
tree | 667c380b682ee548cabbc1a1504f187013176855 /net/lapb/lapb_timer.c | |
parent | e79d0ba605d54dd47f3d8a487d00f264b896966c (diff) | |
download | linux-2e9fdbe5ec7a65b66da9c202cac621a3a366fde3.tar.xz |
rust: drm: device: drop_in_place() the drm::Device in release()
In drm::Device::new() we allocate with __drm_dev_alloc() and return an
ARef<drm::Device>.
When the reference count of the drm::Device falls to zero, the C code
automatically calls drm_dev_release(), which eventually frees the memory
allocated in drm::Device::new().
However, due to that, drm::Device::drop() is never called. As a result
the destructor of the user's private data, i.e. drm::Device::data is
never called. Hence, fix this by calling drop_in_place() from the DRM
device's release callback.
Fixes: 1e4b8896c0f3 ("rust: drm: add device abstraction")
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/20250629153747.72536-1-dakr@kernel.org
Diffstat (limited to 'net/lapb/lapb_timer.c')
0 files changed, 0 insertions, 0 deletions