qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Fabien Chouteau <chouteau@adacore.com>
Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, agraf@suse.de
Subject: Re: [Qemu-devel] [PATCH] Avoid segfault in cpu_dump_state
Date: Tue, 15 May 2012 15:31:21 +0200	[thread overview]
Message-ID: <4FB25AA9.3010905@suse.de> (raw)
In-Reply-To: <1337074749-24189-1-git-send-email-chouteau@adacore.com>

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

> 
> Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
> ---
>  qemu-log.h |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> 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: */
>  
>  /* 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 != 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)

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2012-05-15 13:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-14 14:46 [Qemu-devel] [PATCH] PowerPC: Avoid segfault in cpu_dump_state Fabien Chouteau
2012-05-14 15:39 ` Peter Maydell
2012-05-15  9:39   ` [Qemu-devel] [PATCH] " Fabien Chouteau
2012-05-15 13:31     ` Andreas Färber [this message]
2012-05-15 16:08       ` Fabien Chouteau
2012-05-15 16:20         ` Peter Maydell
2012-05-15 16:45           ` Fabien Chouteau
2012-05-15 18:04             ` Peter Maydell
2012-05-16  3:50         ` Andreas Färber
2012-05-16  8:29           ` Fabien Chouteau
2012-05-16 13:39             ` Fabien Chouteau
2012-05-23 15:43               ` Fabien Chouteau

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=4FB25AA9.3010905@suse.de \
    --to=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=chouteau@adacore.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).