Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- hw/scsi/scsi-bus.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 53ea906..e443193 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -516,6 +516,8 @@ SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, SCSIDevice *d, req->status = -1; req->sense_len = 0; req->ops = reqops; + object_ref(OBJECT(d)); + object_ref(OBJECT(req->bus->qbus.parent)); trace_scsi_req_alloc(req->dev->id, req->lun, req->tag); return req; } @@ -1505,6 +1507,8 @@ void scsi_req_unref(SCSIRequest *req) if (req->ops->free_req) { req->ops->free_req(req); } + object_unref(OBJECT(req->dev)); + object_unref(OBJECT(bus->qbus.parent)); g_free(req); } } -- 1.8.1.4