mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-30 22:50:54 -04:00
drm/xe/vm: fix xe_assert()
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> Reviewed-by: Nirmoy Das <nirmoy.das@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240318103616.26240-2-matthew.auld@intel.com
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user