[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1338451118.2760.1273.camel@edumazet-glaptop>
Date: Thu, 31 May 2012 09:58:38 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Hiroaki SHIMODA <shimoda.hiroaki@...il.com>
Cc: davem@...emloft.net, therbert@...gle.com, denys@...p.net.lb,
netdev@...r.kernel.org
Subject: Re: [PATCH net 1/3] bql: Fix POSDIFF() to integer overflow aware.
On Thu, 2012-05-31 at 07:24 +0900, Hiroaki SHIMODA wrote:
> 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)
Acked-by: Eric Dumazet <edumazet@...gle.com>
--
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