diff options
author | Christian König <christian.koenig@amd.com> | 2018-09-05 11:04:44 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-09-10 23:45:32 -0400 |
commit | fbbf794cbd4872cc4e894ab236d45c97b98008ea (patch) | |
tree | 428d66aabda74770fef30cb9a926802c7c50d0b2 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
parent | 03f67ed10d8522ea27be348e3f87d88f92043e71 (diff) |
drm/amdgpu: set bulk_moveable to false when a per VM is released
Otherwise we might run into a use after free during bulk move.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 9a5b1bbfb77c..f5a960079705 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -2512,8 +2512,12 @@ void amdgpu_vm_bo_rmv(struct amdgpu_device *adev, | |||
2512 | struct amdgpu_bo_va *bo_va) | 2512 | struct amdgpu_bo_va *bo_va) |
2513 | { | 2513 | { |
2514 | struct amdgpu_bo_va_mapping *mapping, *next; | 2514 | struct amdgpu_bo_va_mapping *mapping, *next; |
2515 | struct amdgpu_bo *bo = bo_va->base.bo; | ||
2515 | struct amdgpu_vm *vm = bo_va->base.vm; | 2516 | struct amdgpu_vm *vm = bo_va->base.vm; |
2516 | 2517 | ||
2518 | if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv) | ||
2519 | vm->bulk_moveable = false; | ||
2520 | |||
2517 | list_del(&bo_va->base.bo_list); | 2521 | list_del(&bo_va->base.bo_list); |
2518 | 2522 | ||
2519 | spin_lock(&vm->invalidated_lock); | 2523 | spin_lock(&vm->invalidated_lock); |