diff options
author | Markus Armbruster <armbru@redhat.com> | 2010-07-06 14:37:42 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2010-07-13 17:48:17 +0200 |
commit | ac0c14d71b68ac18f03a876028e332534e1e6a3e (patch) | |
tree | fcac4b12f1ce11f06cd56438d27144996703bb26 /hw | |
parent | 31f54f24bb4a507543c3732c3ac1134ca3a11687 (diff) |
virtio-pci: Check for virtio_blk_init() failure
It can't actually fail now, but the next commit will change that.
s390_virtio_blk_init() already checks for failure, but
virtio_blk_init_pci() doesn't. Fix that.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/virtio-pci.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index c728fffd73..55831665f6 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -551,6 +551,9 @@ static int virtio_blk_init_pci(PCIDevice *pci_dev) return -1; } vdev = virtio_blk_init(&pci_dev->qdev, &proxy->block); + if (!vdev) { + return -1; + } vdev->nvectors = proxy->nvectors; virtio_init_pci(proxy, vdev, PCI_VENDOR_ID_REDHAT_QUMRANET, |