mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RFC] qla2xxx: fix timeout in qla2x00_down_timeout
@ 2007-05-30  8:16 Bill Nottingham
  2007-05-30 11:25 ` Seokmann Ju
  0 siblings, 1 reply; 2+ messages in thread
From: Bill Nottingham @ 2007-05-30  8:16 UTC (permalink / raw)
  To: linux-scsi; +Cc: linux-driver, linux-kernel

iterations is unsigned, so it is impossible to get out of the loop
and return -ETIMEDOUT.

Signed-off-by: Bill Nottingham <notting@redhat.com>

---

If the intention *is* to never fall out of the end of the loop, ignore
this, and just replace it with do {} while (1);.

--- drivers/scsi/qla2xxx/qla_os.c.foo	2007-05-30 04:07:52.000000000 -0400
+++ drivers/scsi/qla2xxx/qla_os.c	2007-05-30 04:08:31.000000000 -0400
@@ -2587,15 +2587,15 @@ qla2x00_down_timeout(struct semaphore *s
 	unsigned int iterations = jiffies_to_msecs(timeout)/100;
 
 	do {
 		if (!down_trylock(sema))
 			return 0;
 		if (msleep_interruptible(step))
 			break;
-	} while (--iterations >= 0);
+	} while (--iterations > 0);
 
 	return -ETIMEDOUT;
 }
 
 /* Firmware interface routines. */
 
 #define FW_BLOBS	5

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

* RE: [PATCH RFC] qla2xxx: fix timeout in qla2x00_down_timeout
  2007-05-30  8:16 [PATCH RFC] qla2xxx: fix timeout in qla2x00_down_timeout Bill Nottingham
@ 2007-05-30 11:25 ` Seokmann Ju
  0 siblings, 0 replies; 2+ messages in thread
From: Seokmann Ju @ 2007-05-30 11:25 UTC (permalink / raw)
  To: Bill Nottingham, linux-scsi; +Cc: Linux Driver, linux-kernel

Thanks for finding. 
Acked-by: Seokmann Ju <seokmann.ju@qlogic.com>

> -----Original Message-----
> From: Bill Nottingham [mailto:notting@redhat.com] 
> Sent: Wednesday, May 30, 2007 1:17 AM
> To: linux-scsi@vger.kernel.org
> Cc: Linux Driver; linux-kernel@vger.kernel.org
> Subject: [PATCH RFC] qla2xxx: fix timeout in qla2x00_down_timeout
> 
> iterations is unsigned, so it is impossible to get out of the 
> loop and return -ETIMEDOUT.
> 
> Signed-off-by: Bill Nottingham <notting@redhat.com>
> 
> ---
> 
> If the intention *is* to never fall out of the end of the 
> loop, ignore this, and just replace it with do {} while (1);.
> 
> --- drivers/scsi/qla2xxx/qla_os.c.foo	2007-05-30 
> 04:07:52.000000000 -0400
> +++ drivers/scsi/qla2xxx/qla_os.c	2007-05-30 
> 04:08:31.000000000 -0400
> @@ -2587,15 +2587,15 @@ qla2x00_down_timeout(struct semaphore *s
>  	unsigned int iterations = jiffies_to_msecs(timeout)/100;
>  
>  	do {
>  		if (!down_trylock(sema))
>  			return 0;
>  		if (msleep_interruptible(step))
>  			break;
> -	} while (--iterations >= 0);
> +	} while (--iterations > 0);
>  
>  	return -ETIMEDOUT;
>  }
>  
>  /* Firmware interface routines. */
>  
>  #define FW_BLOBS	5
> 

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

end of thread, other threads:[~2007-05-30 11:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-30  8:16 [PATCH RFC] qla2xxx: fix timeout in qla2x00_down_timeout Bill Nottingham
2007-05-30 11:25 ` Seokmann Ju

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

all inboxes | Powered by JetHome®