linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Arnd Bergmann <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, dave.hansen@linux.intel.com,
	jpoimboe@redhat.com, mingo@kernel.org, vbabka@suse.cz,
	nico@linaro.org, arnd@arndb.de, bpetkov@suse.de, luto@kernel.org,
	hpa@zytor.com, peterz@infradead.org, ak@linux.intel.com,
	linux-kernel@vger.kernel.org
Subject: [tip:x86/urgent] x86/dumpstack: Avoid uninitlized variable
Date: Fri, 2 Feb 2018 14:36:48 -0800	[thread overview]
Message-ID: <tip-ebfc15019cfa72496c674ffcb0b8ef10790dcddc@git.kernel.org> (raw)
In-Reply-To: <20180202145634.200291-1-arnd@arndb.de>

Commit-ID:  ebfc15019cfa72496c674ffcb0b8ef10790dcddc
Gitweb:     https://git.kernel.org/tip/ebfc15019cfa72496c674ffcb0b8ef10790dcddc
Author:     Arnd Bergmann <arnd@arndb.de>
AuthorDate: Fri, 2 Feb 2018 15:56:17 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 2 Feb 2018 23:33:50 +0100

x86/dumpstack: Avoid uninitlized variable

In some configurations, 'partial' does not get initialized, as shown by
this gcc-8 warning:

arch/x86/kernel/dumpstack.c: In function 'show_trace_log_lvl':
arch/x86/kernel/dumpstack.c:156:4: error: 'partial' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    show_regs_if_on_stack(&stack_info, regs, partial);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This initializes it to false, to get the previous behavior in this case.

Fixes: a9cdbe72c4e8 ("x86/dumpstack: Fix partial register dumps")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Nicolas Pitre <nico@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Borislav Petkov <bpetkov@suse.de>
Cc: Vlastimil Babka <vbabka@suse.cz>
Link: https://lkml.kernel.org/r/20180202145634.200291-1-arnd@arndb.de

---
 arch/x86/kernel/dumpstack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index afbecff..a2d8a39 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -109,7 +109,7 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
 	struct stack_info stack_info = {0};
 	unsigned long visit_mask = 0;
 	int graph_idx = 0;
-	bool partial;
+	bool partial = false;
 
 	printk("%sCall Trace:\n", log_lvl);
 

  parent reply	other threads:[~2018-02-02 22:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-02 14:54 [PATCH 0/3] x86 bugfixes for LTO Arnd Bergmann
2018-02-02 14:56 ` [PATCH 1/3] x86: dumpstack: avoid uninitlized variable Arnd Bergmann
2018-02-02 14:56   ` [PATCH 2/3] x86: fix swsusp_arch_resume prototype Arnd Bergmann
2018-02-02 22:37     ` [tip:x86/urgent] x86/power: Fix " tip-bot for Arnd Bergmann
2018-02-08 10:12     ` [PATCH 2/3] x86: fix " Rafael J. Wysocki
2018-02-02 14:56   ` [PATCH 3/3] x86: error_inject: make just_return_func globally visible Arnd Bergmann
2018-02-03 13:21     ` Masami Hiramatsu
2018-02-13 15:25     ` [tip:x86/urgent] x86/error_inject: Make just_return_func() " tip-bot for Arnd Bergmann
2018-02-02 22:36   ` tip-bot for Arnd Bergmann [this message]
2018-02-05 21:21     ` [tip:x86/urgent] x86/dumpstack: Avoid uninitlized variable Arnd Bergmann
2018-02-05 21:39       ` Josh Poimboeuf
2018-02-05 21:48         ` Arnd Bergmann
2018-02-09 22:24 ` [PATCH 0/3] x86 bugfixes for LTO Chris Wilson
2018-02-09 23:00   ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-ebfc15019cfa72496c674ffcb0b8ef10790dcddc@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=ak@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=bpetkov@suse.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=nico@linaro.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).