diff options
author | xinhui pan <xinhui.pan@amd.com> | 2022-07-07 16:02:41 +0800 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2022-07-07 10:24:59 +0200 |
commit | 7c1aeba7bb977fe327fbc9682e9ccb36134cbf77 (patch) | |
tree | c367b7f598d8f1cb4ee42ee354469cc15bf67564 /drivers/dma-buf/dma-resv.c | |
parent | 9fc33eaaa979d112d10fea729edcd2a2e21aa912 (diff) | |
download | linux-7c1aeba7bb977fe327fbc9682e9ccb36134cbf77.tar.gz linux-7c1aeba7bb977fe327fbc9682e9ccb36134cbf77.tar.bz2 linux-7c1aeba7bb977fe327fbc9682e9ccb36134cbf77.zip |
dma-buf: Fix one use-after-free of fence
Need get the new fence when we replace the old one.
Fixes: 047a1b877ed48 ("dma-buf & drm/amdgpu: remove dma_resv workaround")
Signed-off-by: xinhui pan <xinhui.pan@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220707080241.20060-1-xinhui.pan@amd.com
Signed-off-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'drivers/dma-buf/dma-resv.c')
-rw-r--r-- | drivers/dma-buf/dma-resv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma-buf/dma-resv.c b/drivers/dma-buf/dma-resv.c index 0cce6e4ec946..205acb2c744d 100644 --- a/drivers/dma-buf/dma-resv.c +++ b/drivers/dma-buf/dma-resv.c @@ -343,7 +343,7 @@ void dma_resv_replace_fences(struct dma_resv *obj, uint64_t context, if (old->context != context) continue; - dma_resv_list_set(list, i, replacement, usage); + dma_resv_list_set(list, i, dma_fence_get(replacement), usage); dma_fence_put(old); } } |