44 lines
1.3 KiB
Diff
44 lines
1.3 KiB
Diff
|
|
From c2f55f210d4e021121865ea31037d2751188befd Mon Sep 17 00:00:00 2001
|
||
|
|
From: Yan Wang <wangyan122@huawei.com>
|
||
|
|
Date: Tue, 1 Mar 2022 20:12:12 +0800
|
||
|
|
Subject: [PATCH] scsi-bus: fix unmatched object_unref()
|
||
|
|
|
||
|
|
Fix commit 391dd8f1("scsi-bus: Refactor the code that retries requests"),
|
||
|
|
which split scsi_dma_restart_bh(), but the object_unref() belongs to
|
||
|
|
scsi_dma_restart_bh().
|
||
|
|
So, we should mv object_unref() from scsi_retry_requests() to
|
||
|
|
scsi_dma_restart_bh().
|
||
|
|
|
||
|
|
Signed-off-by: Yan Wang <wangyan122@huawei.com>
|
||
|
|
Signed-off-by: shaodenghui <shaodenghui@huawei.com>
|
||
|
|
---
|
||
|
|
hw/scsi/scsi-bus.c | 5 +++--
|
||
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
|
||
|
|
index cecb02ae7e..7b60ac11f5 100644
|
||
|
|
--- a/hw/scsi/scsi-bus.c
|
||
|
|
+++ b/hw/scsi/scsi-bus.c
|
||
|
|
@@ -167,8 +167,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)
|
||
|
|
@@ -179,6 +177,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)
|
||
|
|
--
|
||
|
|
2.27.0
|
||
|
|
|