aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2020-07-07 18:05:34 +0200
committerMarkus Armbruster <armbru@redhat.com>2020-07-10 15:01:06 +0200
commit79c3e2bc6e78eb9cb197a9b3a9fc885ec1b7c720 (patch)
treeb229e82c0f8f4459d088e10284a13c728f8f5372 /hw
parent0a15a73236cb068cfd28f8c6846f66ab007f81bb (diff)
virtio-crypto-pci: Tidy up virtio_crypto_pci_realize()
virtio_crypto_pci_realize() continues after realization of its "virtio-crypto-device" fails. Only an object_property_set_link() follows; looks harmless to me. Tidy up anyway: return after failure, just like virtio_rng_pci_realize() does. Cc: "Gonglei (Arei)" <arei.gonglei@huawei.com> Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Gonglei < arei.gonglei@huawei.com> Message-Id: <20200707160613.848843-7-armbru@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/virtio/virtio-crypto-pci.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/virtio/virtio-crypto-pci.c b/hw/virtio/virtio-crypto-pci.c
index 72be531c95..0755722288 100644
--- a/hw/virtio/virtio-crypto-pci.c
+++ b/hw/virtio/virtio-crypto-pci.c
@@ -54,7 +54,9 @@ static void virtio_crypto_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
}
virtio_pci_force_virtio_1(vpci_dev);
- qdev_realize(vdev, BUS(&vpci_dev->bus), errp);
+ if (!qdev_realize(vdev, BUS(&vpci_dev->bus), errp)) {
+ return;
+ }
object_property_set_link(OBJECT(vcrypto),
OBJECT(vcrypto->vdev.conf.cryptodev), "cryptodev",
NULL);