diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2011-08-25 16:36:23 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-02-12 20:39:28 -0500 |
commit | 7fbd764881a5f9dc81a378293b7a74227fcc04ed (patch) | |
tree | ee7a8ab5c5f6875b61b89d780a584ab1a139745e /drivers/scsi/mpt2sas | |
parent | 3ec1e88b33a3bdd852ce8e014052acec7a9da8b5 (diff) |
[SCSI] mpt2sas: Fix mismatch in mpt2sas_base_hard_reset_handler() mutex lock-unlock
If ioc->pci_error_recovery is set, goto out in mpt2sas_base_hard_reset_handler()
leads to unlock unheld ioc->reset_in_progress_mutex.
The patch fixes the issue by jumping afer mutex_unlock() call.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: "Nandigama, Nagalakshmi" <Nagalakshmi.Nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/mpt2sas')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index 0b2c95583660..a78036f5e1a6 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c | |||
@@ -4548,7 +4548,7 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, | |||
4548 | printk(MPT2SAS_ERR_FMT "%s: pci error recovery reset\n", | 4548 | printk(MPT2SAS_ERR_FMT "%s: pci error recovery reset\n", |
4549 | ioc->name, __func__); | 4549 | ioc->name, __func__); |
4550 | r = 0; | 4550 | r = 0; |
4551 | goto out; | 4551 | goto out_unlocked; |
4552 | } | 4552 | } |
4553 | 4553 | ||
4554 | if (mpt2sas_fwfault_debug) | 4554 | if (mpt2sas_fwfault_debug) |
@@ -4604,6 +4604,7 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, | |||
4604 | spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); | 4604 | spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); |
4605 | mutex_unlock(&ioc->reset_in_progress_mutex); | 4605 | mutex_unlock(&ioc->reset_in_progress_mutex); |
4606 | 4606 | ||
4607 | out_unlocked: | ||
4607 | dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: exit\n", ioc->name, | 4608 | dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: exit\n", ioc->name, |
4608 | __func__)); | 4609 | __func__)); |
4609 | return r; | 4610 | return r; |