Skip to content

Commit 2abad79

Browse files
andy-shevdavem330
authored andcommitted
qla3xxx: don't allow never end busy loop
The counter variable wasn't increased at all which may stuck under certain circumstances. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 627d2cc commit 2abad79

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/net/ethernet/qlogic/qla3xxx.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,7 @@ static int ql_wait_for_drvr_lock(struct ql3_adapter *qdev)
146146
{
147147
int i = 0;
148148

149-
while (i < 10) {
150-
if (i)
151-
ssleep(1);
152-
149+
do {
153150
if (ql_sem_lock(qdev,
154151
QL_DRVR_SEM_MASK,
155152
(QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index)
@@ -158,7 +155,8 @@ static int ql_wait_for_drvr_lock(struct ql3_adapter *qdev)
158155
"driver lock acquired\n");
159156
return 1;
160157
}
161-
}
158+
ssleep(1);
159+
} while (++i < 10);
162160

163161
netdev_err(qdev->ndev, "Timed out waiting for driver lock...\n");
164162
return 0;

0 commit comments

Comments
 (0)