summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2023-10-20 03:45:43 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2023-10-20 03:45:43 +0000
commit76be13cb01345a2ecb131e19bb07415c909ab7e3 (patch)
tree0cbd9c0e57513301ed61d720aefc30e398a3d3d1 /sys/dev/pci
parentc3f6c5320f104cfbb313056d46eac01a4afcf511 (diff)
drm/amdgpu: add missing NULL check
From Christian Koenig a61d905a86879427e330a5a66cba8b2330dac4d1 in linux-6.1.y/6.1.59 ff89f064dca38e2203790bf876cc7756b8ab2961 in mainline linux
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/amdgpu_object.h2
1 files changed, 1 insertions, 1 deletions
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);