]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/futex: getopt() requires int as return value.
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Wed, 28 May 2025 08:55:19 +0000 (10:55 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 5 Jun 2025 12:37:58 +0000 (14:37 +0200)
commit1a9dcf69c7a97e733aa2fc026db22f22928ca7b7
tree14e5c7cf3e7253c26838e89d22b6818838a73782
parentec7714e4947909190ffb3041a03311a975350fe0
selftests/futex: getopt() requires int as return value.

Mark reported that futex_priv_hash fails on ARM64.
It turns out that the command line parsing does not terminate properly
and ends in the default case assuming an invalid option was passed.

Use an int as the return type for getopt().

Closes: https://lore.kernel.org/all/31869a69-063f-44a3-a079-ba71b2506cce@sirena.org.uk/
Fixes: 3163369407baf ("selftests/futex: Add futex_numa_mpol")
Fixes: cda95faef7bcf ("selftests/futex: Add futex_priv_hash")
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20250528085521.1938355-2-bigeasy@linutronix.de
tools/testing/selftests/futex/functional/futex_numa_mpol.c
tools/testing/selftests/futex/functional/futex_priv_hash.c