diff options
| author | Andrii Nakryiko <[email protected]> | 2023-10-06 17:57:42 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2023-10-06 18:17:28 +0000 |
| commit | 925a01577ea5a70416731c00e42b74c97f41cb6a (patch) | |
| tree | 39947655872d56199dd9a3d986b84b02aa0b38dc /tools/testing/selftests/bpf/prog_tests/connect_ping.c | |
| parent | bpf: Inherit system settings for CPU security mitigations (diff) | |
| download | kernel-925a01577ea5a70416731c00e42b74c97f41cb6a.tar.gz kernel-925a01577ea5a70416731c00e42b74c97f41cb6a.zip | |
selftests/bpf: Fix compiler warnings reported in -O2 mode
Fix a bunch of potentially unitialized variable usage warnings that are
reported by GCC in -O2 mode. Also silence overzealous stringop-truncation
class of warnings.
Signed-off-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/connect_ping.c')
| -rw-r--r-- | tools/testing/selftests/bpf/prog_tests/connect_ping.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/connect_ping.c b/tools/testing/selftests/bpf/prog_tests/connect_ping.c index 289218c2216c..40fe571f2fe7 100644 --- a/tools/testing/selftests/bpf/prog_tests/connect_ping.c +++ b/tools/testing/selftests/bpf/prog_tests/connect_ping.c @@ -28,9 +28,9 @@ static void subtest(int cgroup_fd, struct connect_ping *skel, .sin6_family = AF_INET6, .sin6_addr = IN6ADDR_LOOPBACK_INIT, }; - struct sockaddr *sa; + struct sockaddr *sa = NULL; socklen_t sa_len; - int protocol; + int protocol = -1; int sock_fd; switch (family) { |
