[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 05/46] virtio-crypto-pci: Tidy up virtio_crypto_pci_realize()
From: |
Markus Armbruster |
Subject: |
[PATCH 05/46] virtio-crypto-pci: Tidy up virtio_crypto_pci_realize() |
Date: |
Wed, 24 Jun 2020 18:43:03 +0200 |
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>
---
hw/virtio/virtio-crypto-pci.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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);
--
2.26.2
- Re: [PATCH 07/46] error: Avoid more error_propagate() when error is not used here, (continued)
- [PATCH 40/46] qom: Make functions taking Error ** return bool, not 0/-1, Markus Armbruster, 2020/06/24
- [PATCH 43/46] qdev: Smooth error checking manually, Markus Armbruster, 2020/06/24
- [PATCH 05/46] virtio-crypto-pci: Tidy up virtio_crypto_pci_realize(),
Markus Armbruster <=
- [PATCH 20/46] block: Avoid error accumulation in bdrv_img_create(), Markus Armbruster, 2020/06/24
- [PATCH 38/46] qom: Smooth error checking with Coccinelle, Markus Armbruster, 2020/06/24
- [PATCH 34/46] qom: Don't handle impossible object_property_get_link() failure, Markus Armbruster, 2020/06/24