lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1316787547-1971-1-git-send-email-penberg@cs.helsinki.fi>
Date:	Fri, 23 Sep 2011 17:19:06 +0300
From:	penberg@...helsinki.fi
To:	linux-kernel@...r.kernel.org
Cc:	Pekka Enberg <penberg@...nel.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...hat.com>
Subject: [PATCH 1/2] tracing: Kill uninitialized warning in trace_printk.c

From: Pekka Enberg <penberg@...nel.org>

This patch kill the following bogus warning issued by GCC by shuffling the code
around:

    CC      fs/ext4/balloc.o
  kernel/trace/trace_printk.c: In function ‘module_trace_bprintk_format_notify’:
  kernel/trace/trace_printk.c:65:14: warning: ‘fmt’ may be used uninitialized in this function [-Wuninitialized]
  kernel/trace/trace_printk.c:52:8: note: ‘fmt’ was declared here

Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...hat.com>
Signed-off-by: Pekka Enberg <penberg@...nel.org>
---
 kernel/trace/trace_printk.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/trace_printk.c b/kernel/trace/trace_printk.c
index 1f06468..25e34f5 100644
--- a/kernel/trace/trace_printk.c
+++ b/kernel/trace/trace_printk.c
@@ -49,7 +49,7 @@ static
 void hold_module_trace_bprintk_format(const char **start, const char **end)
 {
 	const char **iter;
-	char *fmt;
+	char *fmt = NULL;
 
 	mutex_lock(&btrace_mutex);
 	for (iter = start; iter < end; iter++) {
@@ -62,7 +62,7 @@ void hold_module_trace_bprintk_format(const char **start, const char **end)
 		tb_fmt = kmalloc(sizeof(*tb_fmt), GFP_KERNEL);
 		if (tb_fmt)
 			fmt = kmalloc(strlen(*iter) + 1, GFP_KERNEL);
-		if (tb_fmt && fmt) {
+		if (fmt) {
 			list_add_tail(&tb_fmt->list, &trace_bprintk_fmt_list);
 			strcpy(fmt, *iter);
 			tb_fmt->fmt = fmt;
-- 
1.7.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ