drm/amdgpu: fix vm init error path
authorChunming Zhou <David1.Zhou@amd.com>
Thu, 28 Jul 2016 09:20:32 +0000 (17:20 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 9 Aug 2016 21:31:49 +0000 (17:31 -0400)
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index 8e642fc48df45c665053a3b835d0abe803d7124b..80120fa4092c76164f460ba5cef4de1bce1d6d83 100644 (file)
@@ -1535,7 +1535,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm)
        r = amd_sched_entity_init(&ring->sched, &vm->entity,
                                  rq, amdgpu_sched_jobs);
        if (r)
-               return r;
+               goto err;
 
        vm->page_directory_fence = NULL;
 
@@ -1565,6 +1565,9 @@ error_free_page_directory:
 error_free_sched_entity:
        amd_sched_entity_fini(&ring->sched, &vm->entity);
 
+err:
+       drm_free_large(vm->page_tables);
+
        return r;
 }