summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Krause <mileskrause5200@gmail.com>2026-07-11 22:47:12 -0400
committerThomas Gleixner <tglx@kernel.org>2026-07-20 21:03:19 +0200
commitd1c656df36d00aad9c810e563f918dbbaf41a7b9 (patch)
tree987d7c45689139b2121f3a0e7b301d31695f2cb7
parent23dd3f884926d945c1f6a7510f5b95164f2906e2 (diff)
selftests/futex: Give circular-list nodes static storage
The registered robust-list head has static storage but points at three automatic lock nodes. GCC warns about storing the address of a local variable in the static head when building the selftest with -Wall. Give the nodes static storage as well. This keeps every object in the circular list alive through child exit without changing the list topology. Signed-off-by: Miles Krause <mileskrause5200@gmail.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: André Almeida <andrealmeid@igalia.com> Link: https://patch.msgid.link/20260711-futex-robust-list-static-nodes-v1-1-723754d75cf5@gmail.com
-rw-r--r--tools/testing/selftests/futex/functional/robust_list.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/futex/functional/robust_list.c b/tools/testing/selftests/futex/functional/robust_list.c
index 3f713bd31f4c..87217c549361 100644
--- a/tools/testing/selftests/futex/functional/robust_list.c
+++ b/tools/testing/selftests/futex/functional/robust_list.c
@@ -536,8 +536,8 @@ static int child_circular_list(void *arg)
{
struct child_args *cargs = arg;
struct __test_metadata *_metadata = cargs->_metadata;
+ static struct lock_struct a, b, c;
struct robust_list_head head;
- struct lock_struct a, b, c;
int ret;
free(cargs);