aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'hw/scsi')
-rw-r--r--hw/scsi/scsi-bus.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
index 4860863f1d..a83939f7d0 100644
--- a/hw/scsi/scsi-bus.c
+++ b/hw/scsi/scsi-bus.c
@@ -283,8 +283,7 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk,
object_unparent(OBJECT(dev));
return NULL;
}
- object_property_set_bool(OBJECT(dev), "share-rw", share_rw, &err);
- if (err != NULL) {
+ if (!object_property_set_bool(OBJECT(dev), "share-rw", share_rw, &err)) {
error_propagate(errp, err);
object_unparent(OBJECT(dev));
return NULL;