public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Chris Wright <chrisw@sous-sol.org>
Cc: kvm-devel@lists.sourceforge.net
Subject: Re: [patch 2/2] [PATCH] virtio-blk: virtio_pci_init can fail
Date: Tue, 22 Apr 2008 00:02:29 -0300	[thread overview]
Message-ID: <20080422030229.GA10614@dmt> (raw)
In-Reply-To: <20080421230531.597310465@sous-sol.org>


Looks good. Does SCSI handle pci_register_device() failure too?

Acked-by: Marcelo Tosatti <mtosatti@redhat.com>


On Mon, Apr 21, 2008 at 04:02:49PM -0700, Chris Wright wrote:
> The pci_device_register() call in virtio_pci_init() can fail.
> Handle this error condition instead of generating a SEGV.
> 
> Cc: Marcelo Tosatti <mtosatti@redhat.com>
> Signed-off-by: Chris Wright <chrisw@sous-sol.org>
> ---
>  qemu/hw/virtio-blk.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> --- a/qemu/hw/virtio-blk.c
> +++ b/qemu/hw/virtio-blk.c
> @@ -163,6 +163,8 @@ void *virtio_blk_init(PCIBus *bus, uint1
>  				       0, VIRTIO_ID_BLOCK,
>  				       0x01, 0x80, 0x00,
>  				       sizeof(struct virtio_blk_config), sizeof(VirtIOBlock));
> +    if (!s)
> +    	return NULL;
>  
>      s->vdev.update_config = virtio_blk_update_config;
>      s->vdev.get_features = virtio_blk_get_features;
> 
> -- 

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

  reply	other threads:[~2008-04-22  3:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-21 23:02 [patch 0/2] pci_register_device can fail Chris Wright
2008-04-21 23:02 ` [patch 1/2] [PATCH] pci nic: " Chris Wright
2008-04-21 23:02 ` [patch 2/2] [PATCH] virtio-blk: virtio_pci_init " Chris Wright
2008-04-22  3:02   ` Marcelo Tosatti [this message]
2008-04-22  5:07     ` Chris Wright
2008-04-22  5:14     ` [patch 3/2] hotadd: lsi_scsi_init " Chris Wright
2008-04-22  6:02       ` Avi Kivity
2008-04-22 11:21 ` [patch 0/2] pci_register_device " Avi Kivity

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=20080422030229.GA10614@dmt \
    --to=mtosatti@redhat.com \
    --cc=chrisw@sous-sol.org \
    --cc=kvm-devel@lists.sourceforge.net \
    /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