Commit 1b9439c9 authored by Gavin Shan's avatar Gavin Shan Committed by Sean Christopherson
Browse files

KVM: selftests: Add missing "break" in rseq_test's param parsing



In commit 0297cdc1 ("KVM: selftests: Add option to rseq test to
override /dev/cpu_dma_latency"), a 'break' is missed before the option
'l' in the argument parsing loop, which leads to an unexpected core
dump in atoi_paranoid(). It tries to get the latency from non-existent
argument.

  host$ ./rseq_test -u
  Random seed: 0x6b8b4567
  Segmentation fault (core dumped)

Add a 'break' before the option 'l' in the argument parsing loop to avoid
the unexpected core dump.

Fixes: 0297cdc1 ("KVM: selftests: Add option to rseq test to override /dev/cpu_dma_latency")
Cc: stable@vger.kernel.org # v6.15+
Signed-off-by: default avatarGavin Shan <gshan@redhat.com>
Link: https://patch.msgid.link/20251124050427.1924591-1-gshan@redhat.com


[sean: describe code change in shortlog]
Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 32bd348b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -215,6 +215,7 @@ int main(int argc, char *argv[])
		switch (opt) {
		case 'u':
			skip_sanity_check = true;
			break;
		case 'l':
			latency = atoi_paranoid(optarg);
			break;