From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUHr0-0003tM-LE for qemu-devel@nongnu.org; Tue, 15 May 2012 09:32:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SUHqZ-0005zc-3p for qemu-devel@nongnu.org; Tue, 15 May 2012 09:31:54 -0400 Received: from cantor2.suse.de ([195.135.220.15]:47897 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUHqY-0005yt-Tn for qemu-devel@nongnu.org; Tue, 15 May 2012 09:31:27 -0400 Message-ID: <4FB25AA9.3010905@suse.de> Date: Tue, 15 May 2012 15:31:21 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1337074749-24189-1-git-send-email-chouteau@adacore.com> In-Reply-To: <1337074749-24189-1-git-send-email-chouteau@adacore.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] Avoid segfault in cpu_dump_state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fabien Chouteau Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, agraf@suse.de Am 15.05.2012 11:39, schrieb Fabien Chouteau: > Do not call cpu_dump_state if logfile is NULL. And where is log_cpu_state() being called from? Its caller is passing NULL already then. Andreas >=20 > Signed-off-by: Fabien Chouteau > --- > qemu-log.h | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) >=20 > diff --git a/qemu-log.h b/qemu-log.h > index fccfb110..2cd5ffa 100644 > --- a/qemu-log.h > +++ b/qemu-log.h > @@ -51,7 +51,12 @@ extern int loglevel; > /* Special cases: */ > =20 > /* cpu_dump_state() logging functions: */ > -#define log_cpu_state(env, f) cpu_dump_state((env), logfile, fprintf, = (f)); > +#define log_cpu_state(env, f) \ > +do { \ > + if (logfile !=3D NULL) { \ > + cpu_dump_state((env), logfile, fprintf, (f)); \ > + } \ > + } while (0) > #define log_cpu_state_mask(b, env, f) do { \ > if (loglevel & (b)) log_cpu_state((env), (f)); \ > } while (0) --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg