qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Hu@pond.sub.org, "Anthony Liguori" <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org, "Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH for-2.4 1/2] qom: Do not reuse errp after a possible error
Date: Wed, 1 Jul 2015 17:03:42 +0100	[thread overview]
Message-ID: <20150701160342.GA19996@redhat.com> (raw)
In-Reply-To: <1435765624-18404-2-git-send-email-armbru@redhat.com>

On Wed, Jul 01, 2015 at 05:47:03PM +0200, Markus Armbruster wrote:
> The argument for an Error **errp parameter must point to a null
> pointer.  If it doesn't, and an error happens, error_set() fails its
> assertion.
> 
> Instead of
> 
>     foo(foos, errp);
>     bar(bars, errp);
> 
> you need to do something like
> 
>     Error *err = NULL;
> 
>     foo(foos, &err);
>     if (err) {
>         error_propagate(errp, err);
>         goto out;
>     }
> 
>     bar(bars, errp);
> out:
> 
> Screwed up in commit 0e55884 (v1.3.0): property_get_bool().
> 
> Screwed up in commit 1f21772 (v2.1.0): object_property_get_enum() and
> object_property_get_uint16List().
> 
> Screwed up in commit a8e3fbe (not yet released): property_get_enum(),
> property_set_enum().
> 
> Found by inspection, no actual crashes observed.
> 
> Fix them up.
> 
> Cc: Andreas Färber <afaerber@suse.de>
> Cc: Anthony Liguori <aliguori@us.ibm.com>
> Cc: Hu Tao <hutao@cn.fujitsu.com
> Cc: Daniel P. Berrange <berrange@redhat.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Looks good to me.

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

  reply	other threads:[~2015-07-01 16:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01 15:47 [Qemu-devel] [PATCH for-2.4 0/2] qom: Fix misuse of Error API Markus Armbruster
2015-07-01 15:47 ` [Qemu-devel] [PATCH for-2.4 1/2] qom: Do not reuse errp after a possible error Markus Armbruster
2015-07-01 16:03   ` Daniel P. Berrange [this message]
2015-07-01 15:47 ` [Qemu-devel] [PATCH for-2.4 2/2] qom: Fix invalid error check in property_get_str() Markus Armbruster
2015-07-20 15:20   ` Eric Blake

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=20150701160342.GA19996@redhat.com \
    --to=berrange@redhat.com \
    --cc=Hu@pond.sub.org \
    --cc=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.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).