[tip: locking/futex] selftests/futex: Give circular-list nodes static storage
From: tip-bot2 for Miles Krause
Date: Mon Jul 20 2026 - 15:05:46 EST
The following commit has been merged into the locking/futex branch of tip:
Commit-ID: d1c656df36d00aad9c810e563f918dbbaf41a7b9
Gitweb: https://git.kernel.org/tip/d1c656df36d00aad9c810e563f918dbbaf41a7b9
Author: Miles Krause <mileskrause5200@xxxxxxxxx>
AuthorDate: Sat, 11 Jul 2026 22:47:12 -04:00
Committer: Thomas Gleixner <tglx@xxxxxxxxxx>
CommitterDate: Mon, 20 Jul 2026 21:03:19 +02:00
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@xxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
Reviewed-by: André Almeida <andrealmeid@xxxxxxxxxx>
Link: https://patch.msgid.link/20260711-futex-robust-list-static-nodes-v1-1-723754d75cf5@xxxxxxxxx
---
tools/testing/selftests/futex/functional/robust_list.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/futex/functional/robust_list.c b/tools/testing/selftests/futex/functional/robust_list.c
index 3f713bd..87217c5 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);