mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
net: phy: mdio-bcm-unimac: fix unsigned wrap-around when decrementing timeout
Change post-decrement compare to pre-decrement to avoid an
unsigned integer wrap-around on timeout. This leads to the following
!timeout check to never to be true so -ETIMEDOUT is never returned.
Detected by CoverityScan, CID#1452623 ("Logically dead code")
Fixes: 69a60b0579 ("net: phy: mdio-bcm-unimac: factor busy polling loop")
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
4da1874190
commit
51ce3e2145
1 changed files with 1 additions and 1 deletions
|
|
@ -71,7 +71,7 @@ static int unimac_mdio_poll(void *wait_func_data)
|
|||
return 0;
|
||||
|
||||
usleep_range(1000, 2000);
|
||||
} while (timeout--);
|
||||
} while (--timeout);
|
||||
|
||||
if (!timeout)
|
||||
return -ETIMEDOUT;
|
||||
|
|
|
|||
Loading…
Reference in a new issue