Commit fa5b5000 authored by Felix Kuehling's avatar Felix Kuehling Committed by Alex Deucher

drm/amdgpu: Fix race condition in MMU notifier release

The release notifier can get called a second time from
mmu_notifier_unregister depending on a race between
__mmu_notifier_release and amdgpu_mn_destroy. Use
mmu_notifier_unregister_no_release to avoid this.
Signed-off-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
parent 477d9f0e
...@@ -86,7 +86,7 @@ static void amdgpu_mn_destroy(struct work_struct *work) ...@@ -86,7 +86,7 @@ static void amdgpu_mn_destroy(struct work_struct *work)
} }
mutex_unlock(&adev->mn_lock); mutex_unlock(&adev->mn_lock);
up_write(&rmn->mm->mmap_sem); up_write(&rmn->mm->mmap_sem);
mmu_notifier_unregister(&rmn->mn, rmn->mm); mmu_notifier_unregister_no_release(&rmn->mn, rmn->mm);
kfree(rmn); kfree(rmn);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment