提交 389e4e04 编写于 作者: D Dan Carpenter 提交者: David S. Miller

qlcnic: fix a timeout loop

The problem here is that at the end of the loop we test for if
idc->vnic_wait_limit is zero, but since idc->vnic_wait_limit-- is a
post-op, it actually ends up set to (u8)-1.  I have fixed this by
moving the decrement inside the loop.

Fixes: 486a5bc7 ('qlcnic: Add support for 83xx suspend and resume.')
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 fe0be35e
......@@ -246,7 +246,8 @@ int qlcnic_83xx_check_vnic_state(struct qlcnic_adapter *adapter)
u32 state;
state = QLCRDX(ahw, QLC_83XX_VNIC_STATE);
while (state != QLCNIC_DEV_NPAR_OPER && idc->vnic_wait_limit--) {
while (state != QLCNIC_DEV_NPAR_OPER && idc->vnic_wait_limit) {
idc->vnic_wait_limit--;
msleep(1000);
state = QLCRDX(ahw, QLC_83XX_VNIC_STATE);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册