From f76f665547f4a954a2c83552a88816fc2a316be0 Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Wed, 27 Jul 2011 12:29:33 +0530 Subject: virtio-balloon: Check if balloon registration failed Multiple balloon registrations are not allowed; check if the registration with the qemu balloon api succeeded. If not, fail the device init. Signed-off-by: Amit Shah Reviewed-by: Markus Armbruster Acked-by: Michael S. Tsirkin --- hw/virtio-pci.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hw/virtio-pci.c') diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index d685243728..ca5f125dae 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -788,6 +788,9 @@ static int virtio_balloon_init_pci(PCIDevice *pci_dev) VirtIODevice *vdev; vdev = virtio_balloon_init(&pci_dev->qdev); + if (!vdev) { + return -1; + } virtio_init_pci(proxy, vdev); return 0; } -- cgit v1.2.3