drm/amdgpu: fix tear down order in amdgpu_vm_pt_free
authorjsg <jsg@openbsd.org>
Thu, 21 Dec 2023 03:45:45 +0000 (03:45 +0000)
committerjsg <jsg@openbsd.org>
Thu, 21 Dec 2023 03:45:45 +0000 (03:45 +0000)
From Christian Koenig
a9e2de19433fe0b63c080e910cce9954745cd903 in linux-6.1.y/6.1.69
ceb9a321e7639700844aa3bf234a4e0884f13b77 in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_vm_pt.c

index 7faa418..383be40 100644 (file)
@@ -631,13 +631,14 @@ static void amdgpu_vm_pt_free(struct amdgpu_vm_bo_base *entry)
 
        if (!entry->bo)
                return;
+
+       entry->bo->vm_bo = NULL;
        shadow = amdgpu_bo_shadowed(entry->bo);
        if (shadow) {
                ttm_bo_set_bulk_move(&shadow->tbo, NULL);
                amdgpu_bo_unref(&shadow);
        }
        ttm_bo_set_bulk_move(&entry->bo->tbo, NULL);
-       entry->bo->vm_bo = NULL;
 
        spin_lock(&entry->vm->status_lock);
        list_del(&entry->vm_status);