]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amdgpu: fix tear down order in amdgpu_vm_pt_free
authorChristian König <christian.koenig@amd.com>
Fri, 8 Dec 2023 12:43:09 +0000 (13:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2023 16:00:26 +0000 (17:00 +0100)
commita9e2de19433fe0b63c080e910cce9954745cd903
treea287cc0c328ea59766c291b2b781b4ce126d516f
parent730b3322b8c3170abd3e25fca7fcbb65ac49dc65
drm/amdgpu: fix tear down order in amdgpu_vm_pt_free

commit ceb9a321e7639700844aa3bf234a4e0884f13b77 upstream.

When freeing PD/PT with shadows it can happen that the shadow
destruction races with detaching the PD/PT from the VM causing a NULL
pointer dereference in the invalidation code.

Fix this by detaching the the PD/PT from the VM first and then
freeing the shadow instead.

Signed-off-by: Christian König <christian.koenig@amd.com>
Fixes: https://gitlab.freedesktop.org/drm/amd/-/issues/2867
Cc: <stable@vger.kernel.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c