[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/53] virtio-crypto-pci: Tidy up virtio_crypto_pci_realize()
From: |
Markus Armbruster |
Subject: |
[PULL 06/53] virtio-crypto-pci: Tidy up virtio_crypto_pci_realize() |
Date: |
Tue, 7 Jul 2020 23:24:16 +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>
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>
---
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
- [PULL 00/53] Error reporting patches patches for 2020-07-07, Markus Armbruster, 2020/07/08
- [PULL 50/53] fw_cfg: Use ERRP_GUARD(), Markus Armbruster, 2020/07/08
- [PULL 02/53] error: Improve error.h's big comment, Markus Armbruster, 2020/07/08
- [PULL 38/53] block/parallels: Simplify parallels_open() after previous commit, Markus Armbruster, 2020/07/08
- [PULL 08/53] qemu-option: Make uses of find_desc_by_name() more similar, Markus Armbruster, 2020/07/08
- [PULL 04/53] qdev: Use returned bool to check for qdev_realize() etc. failure, Markus Armbruster, 2020/07/08
- [PULL 07/53] qemu-option: Check return value instead of @err where convenient, Markus Armbruster, 2020/07/08
- [PULL 32/53] qdev: Use returned bool to check for failure, Coccinelle part, Markus Armbruster, 2020/07/08
- [PULL 06/53] virtio-crypto-pci: Tidy up virtio_crypto_pci_realize(),
Markus Armbruster <=
- [PULL 44/53] qdev: Ignore Error objects where the return value suffices, Markus Armbruster, 2020/07/08
- [PULL 52/53] nbd: Use ERRP_GUARD(), Markus Armbruster, 2020/07/08
- [PULL 27/53] qom: Make functions taking Error ** return bool, not void, Markus Armbruster, 2020/07/08
- [PULL 09/53] qemu-option: Factor out helper find_default_by_name(), Markus Armbruster, 2020/07/08
- [PULL 25/53] qom: Use return values to check for error where that's simpler, Markus Armbruster, 2020/07/08
- [PULL 35/53] error: Eliminate error_propagate() with Coccinelle, part 2, Markus Armbruster, 2020/07/08
- [PULL 19/53] qapi: Use returned bool to check for failure, manual part, Markus Armbruster, 2020/07/08
- [PULL 05/53] macio: Tidy up error handling in macio_newworld_realize(), Markus Armbruster, 2020/07/08
- [PULL 28/53] qom: Use returned bool to check for failure, Coccinelle part, Markus Armbruster, 2020/07/08
- [PULL 22/53] qom: Rename qdev_get_type() to object_get_type(), Markus Armbruster, 2020/07/08