]> git.baikalelectronics.ru Git - kernel.git/commit
drivers: ixgbevf: fix unsigned underflow
authorKulikov Vasiliy <segooon@gmail.com>
Thu, 15 Jul 2010 08:45:57 +0000 (08:45 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Jul 2010 03:27:58 +0000 (20:27 -0700)
commita1c07dd6b327f190ba2bf23df4c41b2a72b9db13
tree4063da161125c5475bcc15c88b1401c967a04e05
parent265de45fcca0c6ca6685e6a15f539348c66a4ba5
drivers: ixgbevf: fix unsigned underflow

'count' is unsigned. It is initialized to zero, then it can be increased
multiple times, and finally it is used in such a way:

   >>>> count--;
   |
   |    /* clear timestamp and dma mappings for remaining portion of packet */
   |    while (count >= 0) {
   |            count--;
   |            ...
   ^
If count is zero here (so, it was never increased), we would have a very
long loop :)

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ixgbevf/ixgbevf_main.c