Skip to content

Commit 7c1aeba

Browse files
xinhui panChristianKoenigAMD
authored andcommitted
dma-buf: Fix one use-after-free of fence
Need get the new fence when we replace the old one. Fixes: 047a1b8 ("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>
1 parent 9fc33ea commit 7c1aeba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma-buf/dma-resv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ void dma_resv_replace_fences(struct dma_resv *obj, uint64_t context,
343343
if (old->context != context)
344344
continue;
345345

346-
dma_resv_list_set(list, i, replacement, usage);
346+
dma_resv_list_set(list, i, dma_fence_get(replacement), usage);
347347
dma_fence_put(old);
348348
}
349349
}

0 commit comments

Comments
 (0)