diff options
| author | Danilo Krummrich <[email protected]> | 2025-06-29 15:37:42 +0000 |
|---|---|---|
| committer | Danilo Krummrich <[email protected]> | 2025-07-03 22:33:56 +0000 |
| commit | 2e9fdbe5ec7a65b66da9c202cac621a3a366fde3 (patch) | |
| tree | 667c380b682ee548cabbc1a1504f187013176855 /rust/helpers/completion.c | |
| parent | nouveau/gsp: add a 50ms delay between fbsr and driver unload rpcs (diff) | |
| download | kernel-2e9fdbe5ec7a65b66da9c202cac621a3a366fde3.tar.gz kernel-2e9fdbe5ec7a65b66da9c202cac621a3a366fde3.zip | |
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 <[email protected]>
Signed-off-by: Danilo Krummrich <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'rust/helpers/completion.c')
0 files changed, 0 insertions, 0 deletions
