Files
linux/rust/kernel
Danilo Krummrich 2e9fdbe5ec 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: 1e4b8896c0 ("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
2025-07-04 00:33:56 +02:00
..
2025-05-30 07:12:05 +02:00
2025-05-29 23:35:44 +02:00
2025-05-19 12:55:40 +05:30
2025-05-20 10:04:06 +05:30
2025-03-16 21:59:19 +01:00
2025-02-22 15:44:19 +01:00
2025-05-27 20:09:59 +02:00
2024-12-20 17:21:04 +01:00
2024-10-08 15:44:36 +02:00
2025-04-29 15:31:07 +02:00
2024-11-04 16:21:44 -05:00