diff options
author | Timur Tabi | 2024-02-02 17:06:07 -0600 |
---|---|---|
committer | Danilo Krummrich | 2024-02-05 18:25:13 +0100 |
commit | 042b5f83841fbf7ce39474412db3b5e4765a7ea7 (patch) | |
tree | 948d75e343fdf13f9a8e1246bba8e6883ad5cdf0 /virt | |
parent | 61712c94782ce105253ee1939cda0c5c025b2c0c (diff) |
drm/nouveau: fix several DMA buffer leaks
Nouveau manages GSP-RM DMA buffers with nvkm_gsp_mem objects. Several of
these buffers are never dealloced. Some of them can be deallocated
right after GSP-RM is initialized, but the rest need to stay until the
driver unloads.
Also futher bullet-proof these objects by poisoning the buffer and
clearing the nvkm_gsp_mem object when it is deallocated. Poisoning
the buffer should trigger an error (or crash) from GSP-RM if it tries
to access the buffer after we've deallocated it, because we were wrong
about when it is safe to deallocate.
Finally, change the mem->size field to a size_t because that's the same
type that dma_alloc_coherent expects.
Cc: <stable@vger.kernel.org> # v6.7
Fixes: 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM")
Signed-off-by: Timur Tabi <ttabi@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240202230608.1981026-1-ttabi@nvidia.com
Diffstat (limited to 'virt')
0 files changed, 0 insertions, 0 deletions