diff options
-rw-r--r-- | drivers/net/igb/e1000_mbx.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/igb/e1000_mbx.c b/drivers/net/igb/e1000_mbx.c index 840782fb5736..ed9058eca45c 100644 --- a/drivers/net/igb/e1000_mbx.c +++ b/drivers/net/igb/e1000_mbx.c | |||
@@ -140,13 +140,13 @@ static s32 igb_poll_for_msg(struct e1000_hw *hw, u16 mbx_id) | |||
140 | struct e1000_mbx_info *mbx = &hw->mbx; | 140 | struct e1000_mbx_info *mbx = &hw->mbx; |
141 | int countdown = mbx->timeout; | 141 | int countdown = mbx->timeout; |
142 | 142 | ||
143 | if (!mbx->ops.check_for_msg) | 143 | if (!countdown || !mbx->ops.check_for_msg) |
144 | goto out; | 144 | goto out; |
145 | 145 | ||
146 | while (mbx->ops.check_for_msg(hw, mbx_id)) { | 146 | while (mbx->ops.check_for_msg(hw, mbx_id)) { |
147 | countdown--; | ||
147 | if (!countdown) | 148 | if (!countdown) |
148 | break; | 149 | break; |
149 | countdown--; | ||
150 | udelay(mbx->usec_delay); | 150 | udelay(mbx->usec_delay); |
151 | } | 151 | } |
152 | out: | 152 | out: |
@@ -165,13 +165,13 @@ static s32 igb_poll_for_ack(struct e1000_hw *hw, u16 mbx_id) | |||
165 | struct e1000_mbx_info *mbx = &hw->mbx; | 165 | struct e1000_mbx_info *mbx = &hw->mbx; |
166 | int countdown = mbx->timeout; | 166 | int countdown = mbx->timeout; |
167 | 167 | ||
168 | if (!mbx->ops.check_for_ack) | 168 | if (!countdown || !mbx->ops.check_for_ack) |
169 | goto out; | 169 | goto out; |
170 | 170 | ||
171 | while (mbx->ops.check_for_ack(hw, mbx_id)) { | 171 | while (mbx->ops.check_for_ack(hw, mbx_id)) { |
172 | countdown--; | ||
172 | if (!countdown) | 173 | if (!countdown) |
173 | break; | 174 | break; |
174 | countdown--; | ||
175 | udelay(mbx->usec_delay); | 175 | udelay(mbx->usec_delay); |
176 | } | 176 | } |
177 | out: | 177 | out: |