mirror of
https://github.com/torvalds/linux.git
synced 2026-03-13 22:36:17 +01:00
Revert "drm/tegra: Use dma_buf from GEM object instance"
This reverts commit482c7e296e. The dma_buf field in struct drm_gem_object is not stable over the object instance's lifetime. The field becomes NULL when user space releases the final GEM handle on the buffer object. This resulted in a NULL-pointer deref. Workarounds in commit5307dce878("drm/gem: Acquire references on GEM handles for framebuffers") and commitf6bfc9afc7("drm/framebuffer: Acquire internal references on GEM handles") only solved the problem partially. They especially don't work for buffer objects without a DRM framebuffer associated. Hence, this revert to going back to using .import_attach->dmabuf. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Simona Vetter <simona.vetter@ffwll.ch> Link: https://lore.kernel.org/r/20250715084549.41473-1-tzimmermann@suse.de
This commit is contained in:
parent
e228e7d382
commit
16fdb3cc6a
1 changed files with 1 additions and 1 deletions
|
|
@ -526,7 +526,7 @@ void tegra_bo_free_object(struct drm_gem_object *gem)
|
|||
if (drm_gem_is_imported(gem)) {
|
||||
dma_buf_unmap_attachment_unlocked(gem->import_attach, bo->sgt,
|
||||
DMA_TO_DEVICE);
|
||||
dma_buf_detach(gem->dma_buf, gem->import_attach);
|
||||
dma_buf_detach(gem->import_attach->dmabuf, gem->import_attach);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue