From: jsg Date: Fri, 20 Oct 2023 03:45:42 +0000 (+0000) Subject: drm/amdgpu: add missing NULL check X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3516e1ba8be9a2df310bb658a1bf11f4d8035a81;p=openbsd drm/amdgpu: add missing NULL check From Christian Koenig a61d905a86879427e330a5a66cba8b2330dac4d1 in linux-6.1.y/6.1.59 ff89f064dca38e2203790bf876cc7756b8ab2961 in mainline linux --- 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);