netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5/8] drivers: ixgbevf: fix unsigned underflow
@ 2010-07-15 18:45 Kulikov Vasiliy
  2010-07-15 18:52 ` Rose, Gregory V
  0 siblings, 1 reply; 3+ messages in thread
From: Kulikov Vasiliy @ 2010-07-15 18:45 UTC (permalink / raw)
  To: kernel-janitors
  Cc: David S. Miller, Jeff Kirsher, Greg Rose, Eric Dumazet,
	Joe Perches, netdev

'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>
---
 drivers/net/ixgbevf/ixgbevf_main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c
index 73f1e75..af49135 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,
 	struct ixgbevf_tx_buffer *tx_buffer_info;
 	unsigned int len;
 	unsigned int total = skb->len;
-	unsigned int offset = 0, size, count = 0;
+	unsigned int offset = 0, size;
+	int count = 0;
 	unsigned int nr_frags = skb_shinfo(skb)->nr_frags;
 	unsigned int f;
 	int i;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-16  3:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-15 18:45 [PATCH 5/8] drivers: ixgbevf: fix unsigned underflow Kulikov Vasiliy
2010-07-15 18:52 ` Rose, Gregory V
2010-07-16  3:28   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).