From 3516e1ba8be9a2df310bb658a1bf11f4d8035a81 Mon Sep 17 00:00:00 2001 From: jsg Date: Fri, 20 Oct 2023 03:45:42 +0000 Subject: [PATCH] drm/amdgpu: add missing NULL check From Christian Koenig a61d905a86879427e330a5a66cba8b2330dac4d1 in linux-6.1.y/6.1.59 ff89f064dca38e2203790bf876cc7756b8ab2961 in mainline linux --- sys/dev/pci/drm/amd/amdgpu/amdgpu_object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_object.h b/sys/dev/pci/drm/amd/amdgpu/amdgpu_object.h index db2ddf155e8..6dc788be338 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_object.h +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_object.h @@ -221,7 +221,7 @@ static inline bool amdgpu_bo_in_cpu_visible_vram(struct amdgpu_bo *bo) struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); struct amdgpu_res_cursor cursor; - if (bo->tbo.resource->mem_type != TTM_PL_VRAM) + if (!bo->tbo.resource || bo->tbo.resource->mem_type != TTM_PL_VRAM) return false; amdgpu_res_first(bo->tbo.resource, 0, amdgpu_bo_size(bo), &cursor); -- 2.20.1