]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: fix use after free during BO move
authorChristian König <christian.koenig@amd.com>
Tue, 7 Sep 2021 07:37:52 +0000 (09:37 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 7 Sep 2021 17:30:49 +0000 (13:30 -0400)
commitda70e9fbc0ee2816a0bce4c495d689d04cd17a6c
tree58b93d1bc08351d4cbddfd136738f1fb4f431e3b
parent82316273af65eb92909e8988f3a78e46ed19fe5b
drm/amdgpu: fix use after free during BO move

The memory backing old_mem is already freed at that point, move the
check a bit more up.

Signed-off-by: Christian König <christian.koenig@amd.com>
Fixes: 0abecef40ccc ("drm/ttm: allocate resource object instead of embedding it v2")
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1699
Acked-by: Nirmoy Das <nirmoy.das@amd.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c