aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-07-15 04:45:57 -0400
committerDavid S. Miller <davem@davemloft.net>2010-07-15 23:27:58 -0400
commit2540ddb5124f883bba3d4af5d8920d44dd66e794 (patch)
tree4063da161125c5475bcc15c88b1401c967a04e05
parent9f27fb8514d0491f1c12052d78d46946f129b8e1 (diff)
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>
-rw-r--r--drivers/net/ixgbevf/ixgbevf_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c
index 73f1e75f68d4..af491352b5e0 100644
--- a/drivers/net/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ixgbevf/ixgbevf_main.c
@@ -2935,7 +2935,8 @@ static int ixgbevf_tx_map(struct ixgbevf_adapter *adapter,
2935 struct ixgbevf_tx_buffer *tx_buffer_info; 2935 struct ixgbevf_tx_buffer *tx_buffer_info;
2936 unsigned int len; 2936 unsigned int len;
2937 unsigned int total = skb->len; 2937 unsigned int total = skb->len;
2938 unsigned int offset = 0, size, count = 0; 2938 unsigned int offset = 0, size;
2939 int count = 0;
2939 unsigned int nr_frags = skb_shinfo(skb)->nr_frags; 2940 unsigned int nr_frags = skb_shinfo(skb)->nr_frags;
2940 unsigned int f; 2941 unsigned int f;
2941 int i; 2942 int i;