From: jsg Date: Mon, 9 Sep 2024 09:07:31 +0000 (+0000) Subject: drm/amd/amdgpu: Check tbo resource pointer X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9be2969ae338d6de9f0583974454abcffb795db2;p=openbsd drm/amd/amdgpu: Check tbo resource pointer From Asad Kamal 4dfec5f5501a27e0a0da00e136d65ef9011ded4c in linux-6.6.y/6.6.50 6cd2b872643bb29bba01a8ac739138db7bd79007 in mainline linux --- 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;