From: Felix Kuehling Date: Thu, 14 Jan 2016 05:35:08 +0000 (-0500) Subject: drm/amdgpu: Fix race condition in MMU notifier release X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fa5b5000308136ad61a33126d8ad380cf1fef016;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: Felix Kuehling Reviewed-by: Christian König --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c index 61f0e3c3172a..1b2105ca5af1 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c @@ -86,7 +86,7 @@ static void amdgpu_mn_destroy(struct work_struct *work) } mutex_unlock(&adev->mn_lock); up_write(&rmn->mm->mmap_sem); - mmu_notifier_unregister(&rmn->mn, rmn->mm); + mmu_notifier_unregister_no_release(&rmn->mn, rmn->mm); kfree(rmn); }