summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/mm/compaction_test.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-08-19 06:16:49 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-08-19 06:16:49 +0200
commitca7df2c7bb5f83fe46aa9ce998b7352c6b28f3a1 (patch)
treef0304a9068bea0b80ba7ed07c0192927c6fcea8f /tools/testing/selftests/mm/compaction_test.c
parent82313624b2ae5a943d16475a566b65c873989e9f (diff)
parent47ac09b91befbb6a235ab620c32af719f8208399 (diff)
Merge 6.11-rc4 into usb-next
We need the usb / thunderbolt fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/mm/compaction_test.c')
-rw-r--r--tools/testing/selftests/mm/compaction_test.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/testing/selftests/mm/compaction_test.c b/tools/testing/selftests/mm/compaction_test.c
index e140558e6f53..2c3a0eb6b22d 100644
--- a/tools/testing/selftests/mm/compaction_test.c
+++ b/tools/testing/selftests/mm/compaction_test.c
@@ -89,9 +89,10 @@ int check_compaction(unsigned long mem_free, unsigned long hugepage_size,
int fd, ret = -1;
int compaction_index = 0;
char nr_hugepages[20] = {0};
- char init_nr_hugepages[20] = {0};
+ char init_nr_hugepages[24] = {0};
- sprintf(init_nr_hugepages, "%lu", initial_nr_hugepages);
+ snprintf(init_nr_hugepages, sizeof(init_nr_hugepages),
+ "%lu", initial_nr_hugepages);
/* We want to test with 80% of available memory. Else, OOM killer comes
in to play */