Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1348015

[PATCH] perf tests: initialize sa.sa_flags

From Colin King <colin.king@canonical.com>
Newsgroups linux.kernel
Subject [PATCH] perf tests: initialize sa.sa_flags
Date 2016-03-02 14:00 +0100
Message-ID <r8exI-7Hb-11@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


From: Colin Ian King <colin.king@canonical.com>

The sa_flags field is not being initialized, so a garbage value is
being passed to sigaction.  Initialize it to zero.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 tools/perf/arch/x86/tests/rdpmc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/arch/x86/tests/rdpmc.c b/tools/perf/arch/x86/tests/rdpmc.c
index 7bb0d13..7945462 100644
--- a/tools/perf/arch/x86/tests/rdpmc.c
+++ b/tools/perf/arch/x86/tests/rdpmc.c
@@ -103,6 +103,7 @@ static int __test__rdpmc(void)
 
 	sigfillset(&sa.sa_mask);
 	sa.sa_sigaction = segfault_handler;
+	sa.sa_flags = 0;
 	sigaction(SIGSEGV, &sa, NULL);
 
 	fd = sys_perf_event_open(&attr, 0, -1, -1,
-- 
2.7.0

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] perf tests: initialize sa.sa_flags Colin King <colin.king@canonical.com> - 2016-03-02 14:00 +0100
  Re: [PATCH] perf tests: initialize sa.sa_flags Peter Zijlstra <peterz@infradead.org> - 2016-03-02 14:00 +0100
    Re: [PATCH] perf tests: initialize sa.sa_flags Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-03-02 14:10 +0100
      Re: [PATCH] perf tests: initialize sa.sa_flags Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-03-02 14:30 +0100
        Q: why didn't GCC warn about this uninitialized variable? (was: Re:  [PATCH] perf tests: initialize sa.sa_flags) Ingo Molnar <mingo@kernel.org> - 2016-03-03 13:20 +0100
          Re: Q: why didn't GCC warn about this uninitialized variable? Colin Ian King <colin.king@canonical.com> - 2016-03-03 13:30 +0100
          Re: Q: why didn't GCC warn about this uninitialized variable? Måns Rullgård <mans@mansr.com> - 2016-03-03 13:40 +0100
            Re: Q: why didn't GCC warn about this uninitialized variable? Joe Perches <joe@perches.com> - 2016-03-03 13:50 +0100
            Re: Q: why didn't GCC warn about this uninitialized variable? Ingo Molnar <mingo@kernel.org> - 2016-03-03 13:50 +0100
          Re: Q: why didn't GCC warn about this uninitialized variable? (was:  Re: [PATCH] perf tests: initialize sa.sa_flags) Jakub Jelinek <jakub@redhat.com> - 2016-03-03 14:00 +0100
            Re: Q: why didn't GCC warn about this uninitialized variable? (was:  Re: [PATCH] perf tests: initialize sa.sa_flags) Ingo Molnar <mingo@kernel.org> - 2016-03-03 14:30 +0100
              Re: Q: why didn't GCC warn about this uninitialized variable? (was:  Re: [PATCH] perf tests: initialize sa.sa_flags) Ingo Molnar <mingo@kernel.org> - 2016-03-03 14:50 +0100
                Re: Q: why didn't GCC warn about this uninitialized variable? (was:  Re: [PATCH] perf tests: initialize sa.sa_flags) Jakub Jelinek <jakub@redhat.com> - 2016-03-03 15:20 +0100
                Re: Q: why didn't GCC warn about this uninitialized variable? (was:  Re: [PATCH] perf tests: initialize sa.sa_flags) Ingo Molnar <mingo@kernel.org> - 2016-03-03 15:50 +0100
                Re: Q: why didn't GCC warn about this uninitialized variable? (was:  Re: [PATCH] perf tests: initialize sa.sa_flags) Ingo Molnar <mingo@kernel.org> - 2016-03-03 16:00 +0100
                Re: Q: why didn't GCC warn about this uninitialized variable? (was:  Re: [PATCH] perf tests: initialize sa.sa_flags) Ingo Molnar <mingo@kernel.org> - 2016-03-03 16:10 +0100
              Re: Q: why didn't GCC warn about this uninitialized variable? (was:  Re: [PATCH] perf tests: initialize sa.sa_flags) Jakub Jelinek <jakub@redhat.com> - 2016-03-03 14:50 +0100
                Re: Q: why didn't GCC warn about this uninitialized variable? (was:  Re: [PATCH] perf tests: initialize sa.sa_flags) Ingo Molnar <mingo@kernel.org> - 2016-03-03 15:10 +0100
      Re: [PATCH] perf tests: initialize sa.sa_flags Peter Zijlstra <peterz@infradead.org> - 2016-03-02 14:30 +0100
  Re: [PATCH] perf tests: initialize sa.sa_flags Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-03-02 14:10 +0100

csiph-web