1 Star 0 Fork 121

lijian/qemu

forked from src-openEuler/qemu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
scsi-bus-fix-unmatched-object_unref.patch 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
KuhnChen 提交于 2022-03-01 20:12 . scsi-bus: fix unmatched object_unref()
From 239ffdcf42e0795b5f025f87fa19ce01642811f2 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>
---
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 5e6f891b9d..9d37f490ce 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)
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jianli-97/qemu.git
git@gitee.com:jianli-97/qemu.git
jianli-97
qemu
qemu
master

搜索帮助