aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHiroaki SHIMODA <shimoda.hiroaki@gmail.com>2012-05-30 08:24:39 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-31 18:18:16 -0400
commit0cfd32b736ae0c36b42697584811042726c07cba (patch)
tree1e667905d1a668206875db4dc5eeb6d72a7c299d /lib
parent401453a31ea8192eb94f9337f5608de907681bfb (diff)
bql: Fix POSDIFF() to integer overflow aware.
POSDIFF() fails to take into account integer overflow case. Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com> Cc: Tom Herbert <therbert@google.com> Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: Denys Fedoryshchenko <denys@visp.net.lb> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/dynamic_queue_limits.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dynamic_queue_limits.c b/lib/dynamic_queue_limits.c
index 6ab4587d052b..c87eb76f2fd4 100644
--- a/lib/dynamic_queue_limits.c
+++ b/lib/dynamic_queue_limits.c
@@ -10,7 +10,7 @@
10#include <linux/jiffies.h> 10#include <linux/jiffies.h>
11#include <linux/dynamic_queue_limits.h> 11#include <linux/dynamic_queue_limits.h>
12 12
13#define POSDIFF(A, B) ((A) > (B) ? (A) - (B) : 0) 13#define POSDIFF(A, B) ((int)((A) - (B)) > 0 ? (A) - (B) : 0)
14 14
15/* Records completed count and recalculates the queue limit */ 15/* Records completed count and recalculates the queue limit */
16void dql_completed(struct dql *dql, unsigned int count) 16void dql_completed(struct dql *dql, unsigned int count)