linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [SCSI] megaraid_sas: Fix mismatch in megasas_reset_fusion mutex lock-unlock
@ 2011-08-24 20:39 Alexey Khoroshilov
  0 siblings, 0 replies; only message in thread
From: Alexey Khoroshilov @ 2011-08-24 20:39 UTC (permalink / raw)
  To: Neela Syam Kolli
  Cc: Alexey Khoroshilov, James E.J. Bottomley, linux-scsi,
	linux-kernel, ldv-project

In case of MEGASAS_HW_CRITICAL_ERROR goto out is invalid since
we have not locked mutex and have not set MEGASAS_FUSION_IN_RESET bit yet.
The patch replaces goto by immediate return.

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

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
 drivers/scsi/megaraid/megaraid_sas_fusion.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index f13e7ab..8b59fb9 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -2057,8 +2057,7 @@ int megasas_reset_fusion(struct Scsi_Host *shost)
 	if (instance->adprecovery == MEGASAS_HW_CRITICAL_ERROR) {
 		printk(KERN_WARNING "megaraid_sas: Hardware critical error, "
 		       "returning FAILED.\n");
-		retval = FAILED;
-		goto out;
+		return FAILED;
 	}
 
 	mutex_lock(&instance->reset_mutex);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-08-24 20:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-24 20:39 [PATCH] [SCSI] megaraid_sas: Fix mismatch in megasas_reset_fusion mutex lock-unlock Alexey Khoroshilov

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).