linux/tools/testing
Viktor Malik 5763790965
selftests/bpf: Silence maybe-uninitialized compiler warning in libarena
When compiling BPF selftests with -O2, GCC reports a maybe-uninitialized
warning in libarena code:

    In file included from /bpf-next/tools/testing/selftests/bpf/prog_tests/libarena_asan.c:11:
    In function ‘libarena_asan_init’,
        inlined from ‘run_test’ at /bpf-next/tools/testing/selftests/bpf/prog_tests/libarena_asan.c:59:8,
        inlined from ‘test_libarena_asan’ at /bpf-next/tools/testing/selftests/bpf/prog_tests/libarena_asan.c:91:2:
    /bpf-next/tools/testing/selftests/bpf/libarena/include/libarena/userspace.h:126:14: error: ‘globals_pages’ may be used uninitialized [-Werror=maybe-uninitialized]
      126 |         args = (struct asan_init_args){
          |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
      127 |                 .arena_all_pages = arena_all_pages,
          |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      128 |                 .arena_globals_pages = globals_pages,
          |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      129 |         };
          |         ~
    /bpf-next/tools/testing/selftests/bpf/libarena/include/libarena/userspace.h: In function ‘test_libarena_asan’:
    /bpf-next/tools/testing/selftests/bpf/libarena/include/libarena/userspace.h:118:13: note: ‘globals_pages’ was declared here
      118 |         u64 globals_pages;
          |             ^~~~~~~~~~~~~

Silence the warning by initializing globals_pages to 0.

Fixes: cfc00618b9 ("selftests/bpf: Add ASAN support for libarena selftests")
Signed-off-by: Viktor Malik <vmalik@redhat.com>
Link: https://lore.kernel.org/bpf/9f77a5c05c3c731ab2655fd66716ab9de4478b15.1784112948.git.vmalik@redhat.com
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
2026-07-20 21:00:57 +02:00
..
crypto/chacha20-s390 crypto: drbg - Fold include/crypto/drbg.h into crypto/drbg.c 2026-05-07 16:09:59 +08:00
cxl Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
fault-injection
ktest ktest: Add logfile to failure directory 2026-04-20 15:23:13 -04:00
kunit kunit:tool: Don't write to stdout when it should be disabled 2026-06-07 20:10:30 -06:00
memblock liveupdate: updates for 7.2-rc1 2026-06-21 09:46:14 -07:00
nvdimm
radix-tree MAINTAINERS: update Liam's email address 2026-04-27 05:54:25 -07:00
rbtree
scatterlist
selftests selftests/bpf: Silence maybe-uninitialized compiler warning in libarena 2026-07-20 21:00:57 +02:00
shared mm/slab: improve kmem_cache_alloc_bulk 2026-06-03 18:20:43 +02:00
vma mm/vma: eliminate mmap_action->error_hook, introduce error_override 2026-06-04 14:45:00 -07:00
vsock vsock/test: add MSG_PEEK after partial recv test 2026-04-16 19:34:22 -07:00