Skip to content

Commit c2c46b1

Browse files
shvipinbonzini
authored andcommitted
KVM: selftests: Make reclaim_period_ms input always be positive
reclaim_period_ms used to be positive only but the commit 0001725 ("KVM: selftests: Add atoi_positive() and atoi_non_negative() for input validation") incorrectly changed it to non-negative validation. Change validation to allow only positive input. Fixes: 0001725 ("KVM: selftests: Add atoi_positive() and atoi_non_negative() for input validation") Signed-off-by: Vipin Sharma <[email protected]> Reported-by: Ben Gardon <[email protected]> Reviewed-by: Ben Gardon <[email protected]> Reviewed-by: Sean Christopherson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent a44b331 commit c2c46b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ int main(int argc, char **argv)
241241
while ((opt = getopt(argc, argv, "hp:t:r")) != -1) {
242242
switch (opt) {
243243
case 'p':
244-
reclaim_period_ms = atoi_non_negative("Reclaim period", optarg);
244+
reclaim_period_ms = atoi_positive("Reclaim period", optarg);
245245
break;
246246
case 't':
247247
token = atoi_paranoid(optarg);

0 commit comments

Comments
 (0)