diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 5e6f891b9d50e9c478372b829039d4f3dfcb8a93..9d37f490cead39daed326ce2be9f2cc73c7fb680 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -166,8 +166,6 @@ void scsi_retry_requests(SCSIDevice *s) scsi_req_unref(req); } aio_context_release(blk_get_aio_context(s->conf.blk)); - /* Drop the reference that was acquired in scsi_dma_restart_cb */ - object_unref(OBJECT(s)); } static void scsi_dma_restart_bh(void *opaque) @@ -178,6 +176,9 @@ static void scsi_dma_restart_bh(void *opaque) s->bh = NULL; scsi_retry_requests(s); + + /* Drop the reference that was acquired in scsi_dma_restart_cb */ + object_unref(OBJECT(s)); } void scsi_req_retry(SCSIRequest *req)