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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120919114258.GA16696@gmail.com>
Date:	Wed, 19 Sep 2012 13:42:58 +0200
From:	Ingo Molnar <mingo@...nel.org>
To:	Namhyung Kim <namhyung@...nel.org>
Cc:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	David Ahern <dsahern@...il.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Jiri Olsa <jolsa@...hat.com>,
	Stephane Eranian <eranian@...gle.com>,
	Mike Galbraith <efault@....de>,
	Namhyung Kim <namhyung.kim@....com>
Subject: Re: [PATCH] tools lib traceevent: Handle alloc_arg failure


* Namhyung Kim <namhyung@...nel.org> wrote:

> +		if (!left) {
> +			do_warning("%s(%d): not enough memory!", __func__, __LINE__);
> +			goto out_free;

> +		if (!right) {
> +			do_warning("%s(%d): not enough memory!", __func__, __LINE__);
> +			goto out_free;
> +		}

> +		if (!left) {
> +			do_warning("%s(%d): not enough memory!", __func__, __LINE__);
> +			goto out_free;
> +		}

> +		if (!left) {
> +			do_warning("%s(%d): not enough memory!", __func__, __LINE__);
> +			goto out_free;
> +		}

> +		if (!right) {
> +			do_warning("%s(%d): not enough memory!", __func__, __LINE__);
> +			goto out_free;
> +		}

> +		if (!left) {
> +			do_warning("%s(%d): not enough memory!", __func__, __LINE__);
> +			goto out_free;
> +		}

These repetitive patterns are seriously uglifying the code and 
are crying out loud for a out_war_free label:

		if (!left)
			goto out_warn_free;

(The function here seems to be rather large as well, making it a 
possible candidate for shrinkage/splitup.)

Thanks,

	Ingo
--
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