public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sym8xx_2: Fixes call to wait_for_completion_timeout() with NULL argument
@ 2008-01-07 21:56 Krzysztof Helt
  2008-01-07 22:39 ` James Bottomley
  0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Helt @ 2008-01-07 21:56 UTC (permalink / raw)
  To: linux-scsi; +Cc: matthew

From: Krzysztof Helt <krzysztof.h1@wp.pl>

This patch fixes call to wait_for_completion_timeout()
with NULL argument.

Signed-off-by: Krzysztof Helt <krzysztof.h1@w.pl>

---

diff -urp linux-ref/drivers/scsi/sym53c8xx_2/sym_glue.c linux-new/drivers/scsi/sym53c8xx_2/sym_glue.c
--- linux-ref/drivers/scsi/sym53c8xx_2/sym_glue.c	2007-10-28 11:11:02.000000000 +0100
+++ linux-new/drivers/scsi/sym53c8xx_2/sym_glue.c	2007-10-28 14:25:08.000000000 +0100
@@ -609,8 +609,7 @@ static int sym_eh_handler(int op, char *
 	 */
 #define WAIT_FOR_PCI_RECOVERY	35
 	if (pci_channel_offline(pdev)) {
-		struct completion *io_reset;
-		int finished_reset = 0;
+		struct completion *io_reset = NULL;
 		init_completion(&eh_done);
 		spin_lock_irq(shost->host_lock);
 		/* Make sure we didn't race */
@@ -618,15 +617,12 @@ static int sym_eh_handler(int op, char *
 			if (!sym_data->io_reset)
 				sym_data->io_reset = &eh_done;
 			io_reset = sym_data->io_reset;
-		} else {
-			finished_reset = 1;
 		}
 		spin_unlock_irq(shost->host_lock);
-		if (!finished_reset)
-			finished_reset = wait_for_completion_timeout(io_reset,
-						WAIT_FOR_PCI_RECOVERY*HZ);
-		if (!finished_reset)
-			return SCSI_FAILED;
+		if (io_reset &&
+		    !wait_for_completion_timeout(io_reset,
+						 WAIT_FOR_PCI_RECOVERY * HZ))
+				return SCSI_FAILED;
 	}
 
 	spin_lock_irq(shost->host_lock);


----------------------------------------------------------------------
Walcz z zombie jako kosmiczny marine!
Kliknij >>> http://link.interia.pl/f1cc3


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-08 15:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-07 21:56 [PATCH] sym8xx_2: Fixes call to wait_for_completion_timeout() with NULL argument Krzysztof Helt
2008-01-07 22:39 ` James Bottomley
2008-01-08  6:40   ` [PATCH] sym8xx_2: kill compilation warning Krzysztof Helt
2008-01-08 15:35     ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox