aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb4vf/t4vf_hw.c
diff options
context:
space:
mode:
authorCasey Leedom <leedom@chelsio.com>2010-07-19 20:51:46 -0400
committerDavid S. Miller <davem@davemloft.net>2010-07-20 15:42:42 -0400
commit024e6293f959dc86827284bc1d7c93c8baed1ec6 (patch)
tree72b3e734cd63e93a38bac3c76d267d0f1e0b64f2 /drivers/net/cxgb4vf/t4vf_hw.c
parente7c38157c61649e66f853d7b9f109119b8361448 (diff)
cxgb4vf: Fix off-by-one error checking for the end of the mailbox delay array
Fix off-by-one error in checking for the end of the mailbox response delay array. We ended up walking off the end and, if we were unlucky, we'd end up pulling in a 0 and never terminate the mailbox response delay loop ... Signed-off-by: Casey Leedom <leedom@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cxgb4vf/t4vf_hw.c')
-rw-r--r--drivers/net/cxgb4vf/t4vf_hw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/cxgb4vf/t4vf_hw.c b/drivers/net/cxgb4vf/t4vf_hw.c
index 1ef252864b9c..ea1c123f0cb4 100644
--- a/drivers/net/cxgb4vf/t4vf_hw.c
+++ b/drivers/net/cxgb4vf/t4vf_hw.c
@@ -163,7 +163,7 @@ int t4vf_wr_mbox_core(struct adapter *adapter, const void *cmd, int size,
163 for (i = 0; i < 500; i += ms) { 163 for (i = 0; i < 500; i += ms) {
164 if (sleep_ok) { 164 if (sleep_ok) {
165 ms = delay[delay_idx]; 165 ms = delay[delay_idx];
166 if (delay_idx < ARRAY_SIZE(delay)) 166 if (delay_idx < ARRAY_SIZE(delay) - 1)
167 delay_idx++; 167 delay_idx++;
168 msleep(ms); 168 msleep(ms);
169 } else 169 } else