summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorYe Bin <yebin10@huawei.com>2020-07-17 17:09:20 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2020-07-24 22:09:57 -0400
commitf30785db7546520acd53aac7497d42352ff031e0 (patch)
treeee8d9a0ac1c8fcb0e63ab28ea137b660cc841228 /drivers
parente73a5e8e8003978e65d368f5475e36e1e2a0613b (diff)
downloadlinux-f30785db7546520acd53aac7497d42352ff031e0.tar.bz2
scsi: core: Add missing scsi_device_put() in scsi_host_block()
The scsi_host_block() case was missing in commit 4dea170f4fb2 ("scsi: core: Fix incorrect usage of shost_for_each_device"). Link: https://lore.kernel.org/r/20200717090921.29243-1-yebin10@huawei.com Fixes: 2bb955840c1d ("scsi: core: add scsi_host_(block,unblock) helper function") Fixes: 4dea170f4fb2 ("scsi: core: Fix incorrect usage of shost_for_each_device") Signed-off-by: Ye Bin <yebin10@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/scsi_lib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index be8f5050f837..27b52fcb5970 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -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;
+ }
}
/*