qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Zhangjixiang <jixiang_zhang@h3c.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] HMP: Initialize err before using
Date: Tue, 20 Mar 2018 11:04:51 +0000	[thread overview]
Message-ID: <20180320110451.GA7665@work-vm> (raw)
In-Reply-To: <CC0ED444C2C80B429092A9F3715307D9D457069E@H3CMLB12-EX.srv.huawei-3com.com>

* Zhangjixiang (jixiang_zhang@h3c.com) wrote:
> When bdrv_snapshot_delete return fail, the errp will not be
> assigned a valid value in error_propagate as errp didn't be
> initialized in hmp_delvm, then error_reportf_err will use an
> uninitialized value(call by hmp_delvm), and qemu crash.
> 
> Signed-off-by: zhangjixiang <jixiang_zhang@h3c.com>

Queued.
Note, that even in this version something is corrupting the
patch; something has lost the space at the start of the line in the
first two lines of the patch; so something is still a bit odd in
your mail/patch generation.

Dave

> ---
> hmp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hmp.c b/hmp.c
> index 7870d6a300..4a4da004e9 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -1340,7 +1340,7 @@ void hmp_savevm(Monitor *mon, const QDict *qdict)
> void hmp_delvm(Monitor *mon, const QDict *qdict)
> {
>      BlockDriverState *bs;
> -    Error *err;
> +    Error *err = NULL;
>      const char *name = qdict_get_str(qdict, "name");
>      if (bdrv_all_delete_snapshot(name, &bs, &err) < 0) {
> --
> 2.11.0
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  parent reply	other threads:[~2018-03-20 11:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07  7:02 [Qemu-devel] [PATCH] HMP: Initialize err before using Zhangjixiang
2018-03-07  9:52 ` Dr. David Alan Gilbert
2018-03-20 11:04 ` Dr. David Alan Gilbert [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-02-25  3:21 Zhangjixiang
2018-02-26 20:03 ` Dr. David Alan Gilbert

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=20180320110451.GA7665@work-vm \
    --to=dgilbert@redhat.com \
    --cc=jixiang_zhang@h3c.com \
    --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).