[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20120531072439.6c634a0b.shimoda.hiroaki@gmail.com>
Date: Thu, 31 May 2012 07:24:39 +0900
From: Hiroaki SHIMODA <shimoda.hiroaki@...il.com>
To: davem@...emloft.net
Cc: therbert@...gle.com, eric.dumazet@...il.com, denys@...p.net.lb,
netdev@...r.kernel.org
Subject: [PATCH net 1/3] bql: Fix POSDIFF() to integer overflow aware.
POSDIFF() fails to take into account integer overflow case.
Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@...il.com>
Cc: Tom Herbert <therbert@...gle.com>
Cc: Eric Dumazet <eric.dumazet@...il.com>
Cc: Denys Fedoryshchenko <denys@...p.net.lb>
---
lib/dynamic_queue_limits.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/dynamic_queue_limits.c b/lib/dynamic_queue_limits.c
index 6ab4587..c87eb76 100644
--- a/lib/dynamic_queue_limits.c
+++ b/lib/dynamic_queue_limits.c
@@ -10,7 +10,7 @@
#include <linux/jiffies.h>
#include <linux/dynamic_queue_limits.h>
-#define POSDIFF(A, B) ((A) > (B) ? (A) - (B) : 0)
+#define POSDIFF(A, B) ((int)((A) - (B)) > 0 ? (A) - (B) : 0)
/* Records completed count and recalculates the queue limit */
void dql_completed(struct dql *dql, unsigned int count)
--
1.7.3.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists