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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 18 Mar 2010 16:03:20 -0400
From:	Masami Hiramatsu <mhiramat@...hat.com>
To:	mingo@...hat.com, hpa@...or.com, acme@...hat.com, paulus@...ba.org,
	linux-kernel@...r.kernel.org, fweisbec@...il.com,
	a.p.zijlstra@...llo.nl, efault@....de, tglx@...utronix.de,
	mhiramat@...hat.com, mingo@...e.hu
CC:	linux-tip-commits@...r.kernel.org
Subject: Re: [tip:perf/core] perf events: Fix false positive build warning
 with older GCC's

tip-bot for Ingo Molnar wrote:
> Commit-ID:  55632770d7298835645489828af87f854c47749c
> Gitweb:     http://git.kernel.org/tip/55632770d7298835645489828af87f854c47749c
> Author:     Ingo Molnar <mingo@...e.hu>
> AuthorDate: Thu, 18 Mar 2010 16:51:16 +0100
> Committer:  Ingo Molnar <mingo@...e.hu>
> CommitDate: Thu, 18 Mar 2010 17:03:24 +0100
> 
> perf events: Fix false positive build warning with older GCC's
> 
> gcc 4.2.1 produces:
> 
>  util/probe-event.c: In function 'add_perf_probe_events':
>  util/probe-event.c:883: warning: 'tev' may be used uninitialized in this function
>  make: *** [util/probe-event.o] Error 1
> 
> Newer GCCs get this right.
> 
> To work it around, initialize the variable to NULL so that older GCCs see
> it as initialized too.

Hmm, indeed. this code implies that ntevs > 0, it seems that we'd better
check it first (e.g. 'if(ntevs <= 0) return;') too.

Thank you,

> 
> Cc: Masami Hiramatsu <mhiramat@...hat.com>
> Cc: Frederic Weisbecker <fweisbec@...il.com>
> Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
> Cc: Paul Mackerras <paulus@...ba.org>
> Cc: Mike Galbraith <efault@....de>
> Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> LKML-Reference: <20100316220612.32050.33806.stgit@...alhost6.localdomain6>
> Signed-off-by: Ingo Molnar <mingo@...e.hu>
> ---
>  tools/perf/util/probe-event.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index f333269..c6603f3 100644
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -880,7 +880,7 @@ static void __add_kprobe_trace_events(struct perf_probe_event *pev,
>  				      int ntevs, bool allow_suffix)
>  {
>  	int i, fd;
> -	struct kprobe_trace_event *tev;
> +	struct kprobe_trace_event *tev = NULL;
>  	char buf[64];
>  	const char *event, *group;
>  	struct strlist *namelist;
> --
> 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/

-- 
Masami Hiramatsu
e-mail: mhiramat@...hat.com
--
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