Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/vm: fix xe_assert()
@ 2024-03-18 10:36 Matthew Auld
  2024-03-18 11:04 ` Nirmoy Das
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Matthew Auld @ 2024-03-18 10:36 UTC (permalink / raw)
  To: intel-xe; +Cc: Nirmoy Das

The region can be used an index into the region_to_mem_type, so we
should be asserting that it is less than the ARRAY_SIZE here.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/xe/xe_vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index cbb9b8935c90..51d62323d9ee 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -2033,7 +2033,7 @@ static int xe_vm_prefetch(struct xe_vm *vm, struct xe_vma *vma,
 	struct xe_exec_queue *wait_exec_queue = to_wait_exec_queue(vm, q);
 	int err;
 
-	xe_assert(vm->xe, region <= ARRAY_SIZE(region_to_mem_type));
+	xe_assert(vm->xe, region < ARRAY_SIZE(region_to_mem_type));
 
 	if (!xe_vma_has_no_bo(vma)) {
 		err = xe_bo_migrate(xe_vma_bo(vma), region_to_mem_type[region]);
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-03-18 18:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-18 10:36 [PATCH] drm/xe/vm: fix xe_assert() Matthew Auld
2024-03-18 11:04 ` Nirmoy Das
2024-03-18 17:25 ` ✓ CI.Patch_applied: success for " Patchwork
2024-03-18 17:26 ` ✓ CI.checkpatch: " Patchwork
2024-03-18 17:26 ` ✓ CI.KUnit: " Patchwork
2024-03-18 17:38 ` ✓ CI.Build: " Patchwork
2024-03-18 17:43 ` ✓ CI.Hooks: " Patchwork
2024-03-18 17:44 ` ✓ CI.checksparse: " Patchwork
2024-03-18 18:17 ` ✓ CI.BAT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox