qla2xxx: fix timeout in qla2x00_down_timeout
RFC PATCH 1/1 qla2xxx: fix timeout in qla2x00_down_timeout
iterations is unsigned, so it is impossible to get out of the loop and return -ETIMEDOUT.
---
If the intention *is* to never fall out of the end of the loop, ignore this, and just replace it with do {} while (1);.
scsi/qla2xxx/qla_os.c renamed from scsi/qla2xxx/qla_os.c.foo +1 -1
@@ -2587,15 +2587,15 @@ qla2x00_down_timeout(struct semaphore *sunsigned 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
Thanks for finding.
Quoted 39 lines
-----Original Message-----
From: Bill Nottingham [mailto:[email protected]]
Sent: Wednesday, May 30, 2007 1:17 AM
To: [email protected]
Cc: Linux Driver; [email protected]
Subject: [PATCH RFC] qla2xxx: fix timeout inqla2x00_down_timeoutiterations is unsigned, so it is impossible to get out of the loop and return
-ETIMEDOUT.Signed-off-by Bill Nottingham <[email protected]>---
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.foo2007-05-30
04:07:52.000000000 -0400
+++drivers/scsi/qla2xxx/qla_os.c2007-05-30
04:08:31.000000000 -0400scsi/qla2xxx/qla_os.c renamed from scsi/qla2xxx/qla_os.c.foo +1
-1@@ -2587,15 +2587,15 @@ qla2x00_down_timeout(struct semaphore *sunsigned 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