mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
drm/amdgpu: fix potential double drop fence reference
[ Upstream commit 946ab8db69 ]
The object fence is not set to NULL after its reference is dropped. As a
result, its reference may be dropped again if error occurs after that,
which may lead to a use after free bug. To avoid the issue, fence is
explicitly set to NULL after dropping its reference.
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
7b3fe663da
commit
2c528fa3c4
|
|
@ -138,6 +138,7 @@ static void amdgpu_do_test_moves(struct amdgpu_device *adev)
|
|||
}
|
||||
|
||||
dma_fence_put(fence);
|
||||
fence = NULL;
|
||||
|
||||
r = amdgpu_bo_kmap(vram_obj, &vram_map);
|
||||
if (r) {
|
||||
|
|
@ -183,6 +184,7 @@ static void amdgpu_do_test_moves(struct amdgpu_device *adev)
|
|||
}
|
||||
|
||||
dma_fence_put(fence);
|
||||
fence = NULL;
|
||||
|
||||
r = amdgpu_bo_kmap(gtt_obj[i], >t_map);
|
||||
if (r) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user