From 25548a05578dd212ad8a2c881af2221b7c015a78 Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 20 May 2024 05:10:45 +0000 Subject: [PATCH] drm/amdgpu: Fix comparison in amdgpu_res_cpu_visible From Michel Daenzer 52c1af381cb8bf72f2600ea02ba03d05fee2d733 in linux-6.6.y/6.6.3 8d2c930735f850e5be6860aeb39b27ac73ca192f in mainline linux --- sys/dev/pci/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_ttm.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_ttm.c index 7f90c3e977e..369f01f3298 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_ttm.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_ttm.c @@ -432,7 +432,7 @@ bool amdgpu_res_cpu_visible(struct amdgpu_device *adev, amdgpu_res_first(res, 0, res->size, &cursor); while (cursor.remaining) { - if ((cursor.start + cursor.size) >= adev->gmc.visible_vram_size) + if ((cursor.start + cursor.size) > adev->gmc.visible_vram_size) return false; amdgpu_res_next(&cursor, cursor.size); } -- 2.20.1