Skip to content

Commit

Permalink
x86/mm/pat: cpa-test: fix length for CPA_ARRAY test
Browse files Browse the repository at this point in the history
The CPA_ARRAY test always uses len[1] as numpages argument to
change_page_attr_set() although the addresses array is different each
iteration of the test loop.

Replace len[1] with len[i] to have numpages matching the addresses array.

Fixes: ecc729f ("x86/mm/cpa: Add ARRAY and PAGES_ARRAY selftests")
Signed-off-by: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250126074733.1384926-2-rppt@kernel.org
  • Loading branch information
Mike Rapoport (Microsoft) authored and Peter Zijlstra committed Feb 3, 2025
1 parent 2014c95 commit 33ea120
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/mm/pat/cpa-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ static int pageattr_test(void)
break;

case 1:
err = change_page_attr_set(addrs, len[1], PAGE_CPA_TEST, 1);
err = change_page_attr_set(addrs, len[i], PAGE_CPA_TEST, 1);
break;

case 2:
Expand Down

0 comments on commit 33ea120

Please sign in to comment.