diff mbox series

scsi: smartpqi: unlock on error in pqi_submit_raid_request_synchronous()

Message ID 20190529110739.GD19119@mwanda (mailing list archive)
State Mainlined
Commit cc8f52609bb4177febade24d11713e20c0893b0a
Headers show
Series scsi: smartpqi: unlock on error in pqi_submit_raid_request_synchronous() | expand

Commit Message

Dan Carpenter May 29, 2019, 11:07 a.m. UTC
We need to drop the "ctrl_info->sync_request_sem" lock before returning.

Fixes: 6c223761eb54 ("smartpqi: initial commit of Microsemi smartpqi driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/scsi/smartpqi/smartpqi_init.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Martin K. Petersen June 5, 2019, 2:23 a.m. UTC | #1
Dan,

> We need to drop the "ctrl_info->sync_request_sem" lock before returning.

Applied to 5.2/scsi-fixes, thanks!
diff mbox series

Patch

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index b17761eafca9..e57f3f3836ba 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -4046,8 +4046,10 @@  static int pqi_submit_raid_request_synchronous(struct pqi_ctrl_info *ctrl_info,
 				return -ETIMEDOUT;
 			msecs_blocked =
 				jiffies_to_msecs(jiffies - start_jiffies);
-			if (msecs_blocked >= timeout_msecs)
-				return -ETIMEDOUT;
+			if (msecs_blocked >= timeout_msecs) {
+				rc = -ETIMEDOUT;
+				goto out;
+			}
 			timeout_msecs -= msecs_blocked;
 		}
 	}