提交 f30785db 编写于 作者: Y Ye Bin 提交者: Martin K. Petersen

scsi: core: Add missing scsi_device_put() in scsi_host_block()

The scsi_host_block() case was missing in commit 4dea170f ("scsi: core:
Fix incorrect usage of shost_for_each_device").

Link: https://lore.kernel.org/r/20200717090921.29243-1-yebin10@huawei.com
Fixes: 2bb95584 ("scsi: core: add scsi_host_(block,unblock) helper function")
Fixes: 4dea170f ("scsi: core: Fix incorrect usage of shost_for_each_device")
Signed-off-by: NYe Bin <yebin10@huawei.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 e73a5e8e
......@@ -2819,8 +2819,10 @@ scsi_host_block(struct Scsi_Host *shost)
mutex_lock(&sdev->state_mutex);
ret = scsi_internal_device_block_nowait(sdev);
mutex_unlock(&sdev->state_mutex);
if (ret)
if (ret) {
scsi_device_put(sdev);
break;
}
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册