]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers/scsi/mpt2sas/mpt2sas_base.c: fix mismatch in mpt2sas_base_hard_reset_handler...
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Tue, 8 Nov 2011 00:20:05 +0000 (11:20 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 16 Nov 2011 01:46:59 +0000 (12:46 +1100)
If ioc->pci_error_recovery is set, goto out in
mpt2sas_base_hard_reset_handler() leads to unlock unheld
ioc->reset_in_progress_mutex.

Fix the issue by jumping afer mutex_unlock() call.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/scsi/mpt2sas/mpt2sas_base.c

index beda04a8404b5b72579f90e7f870bb8b6aeb1a98..6bbe6bf7fc112e368511d230782f05187221f2a4 100644 (file)
@@ -4517,7 +4517,7 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag,
                printk(MPT2SAS_ERR_FMT "%s: pci error recovery reset\n",
                    ioc->name, __func__);
                r = 0;
-               goto out;
+               goto out_unlocked;
        }
 
        if (mpt2sas_fwfault_debug)
@@ -4573,6 +4573,7 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag,
        spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
        mutex_unlock(&ioc->reset_in_progress_mutex);
 
+ out_unlocked:
        dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: exit\n", ioc->name,
            __func__));
        return r;