scsi: smartpqi: unlock on error in pqi_submit_raid_request_synchronous()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 29 May 2019 11:07:39 +0000 (14:07 +0300)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 5 Jun 2019 02:22:29 +0000 (22:22 -0400)
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>
Acked-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/smartpqi/smartpqi_init.c

index d6be4e8..8fd5ffc 100644 (file)
@@ -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;
                }
        }