All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>,
	Chunyan Liu <cyliu@suse.com>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH for-2.1] block/cow: Avoid use of uninitialized cow_bs in error path
Date: Mon, 30 Jun 2014 12:07:28 -0600	[thread overview]
Message-ID: <53B1A760.5070806@redhat.com> (raw)
In-Reply-To: <1404151417-474-1-git-send-email-peter.maydell@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 786 bytes --]

On 06/30/2014 12:03 PM, Peter Maydell wrote:
> Commit 25814e8987 introduced an error-exit code path which does
> a "goto exit" before the cow_bs variable is initialized, meaning
> we would call bdrv_unref() on an uninitialized variable and
> likely segfault. Fix this by moving the NULL-initialization
> to the top of the function and making the exit code path handle
> the case where it is NULL.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  block/cow.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

(and I obviously missed catching this on my first review of the patch)

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2014-06-30 18:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30 18:03 [Qemu-devel] [PATCH for-2.1] block/cow: Avoid use of uninitialized cow_bs in error path Peter Maydell
2014-06-30 18:07 ` Eric Blake [this message]
2014-07-01  7:22 ` Stefan Hajnoczi

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=53B1A760.5070806@redhat.com \
    --to=eblake@redhat.com \
    --cc=cyliu@suse.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=wdongxu@linux.vnet.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.