linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: core: Fix "scsi: core: add scsi_host_(block,unblock) helper function"
@ 2020-07-17  9:09 Ye Bin
  2020-07-17  9:09 ` [PATCH] scsi: Delete unnecessary allocate buffer for every loop when print command Ye Bin
  0 siblings, 1 reply; 3+ messages in thread
From: Ye Bin @ 2020-07-17  9:09 UTC (permalink / raw)
  To: linux-scsi, martin.petersen; +Cc: bvanassche, sashal, Ye Bin

In commit 4dea170f4fb2 ("scsi: core: Fix incorrect usage of shost_for_each_device")
fix usage of shost_for_each_device in function scsi_host_block.

Fix: 2bb955840c1d("scsi: core: add scsi_host_(block,unblock) helper function")
Signed-off-by: Ye Bin <yebin10@huawei.com>
---
 drivers/scsi/scsi_lib.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index f3bf2648105c..65fde27b8b08 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -2811,8 +2811,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;
+		}
 	}
 
 	/*
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-25  2:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-17  9:09 [PATCH] scsi: core: Fix "scsi: core: add scsi_host_(block,unblock) helper function" Ye Bin
2020-07-17  9:09 ` [PATCH] scsi: Delete unnecessary allocate buffer for every loop when print command Ye Bin
2020-07-25  2:50   ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).