From 9be2969ae338d6de9f0583974454abcffb795db2 Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 9 Sep 2024 09:07:31 +0000 Subject: [PATCH] drm/amd/amdgpu: Check tbo resource pointer From Asad Kamal 4dfec5f5501a27e0a0da00e136d65ef9011ded4c in linux-6.6.y/6.6.50 6cd2b872643bb29bba01a8ac739138db7bd79007 in mainline linux --- sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c index 2c2bb603522..55095fd4897 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c @@ -4605,7 +4605,8 @@ static int amdgpu_device_recover_vram(struct amdgpu_device *adev) shadow = vmbo->shadow; /* No need to recover an evicted BO */ - if (shadow->tbo.resource->mem_type != TTM_PL_TT || + if (!shadow->tbo.resource || + shadow->tbo.resource->mem_type != TTM_PL_TT || shadow->tbo.resource->start == AMDGPU_BO_INVALID_OFFSET || shadow->parent->tbo.resource->mem_type != TTM_PL_VRAM) continue; -- 2.20.1