Commit ba51edae authored by Nogah Frankel's avatar Nogah Frankel Committed by Greg Kroah-Hartman

net_sched: red: Avoid devision by zero


[ Upstream commit 5c472203 ]

Do not allow delta value to be zero since it is used as a divisor.

Fixes: 8af2a218 ("sch_red: Adaptative RED AQM")
Signed-off-by: default avatarNogah Frankel <nogahf@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 034317d4
...@@ -178,7 +178,7 @@ static inline void red_set_parms(struct red_parms *p, ...@@ -178,7 +178,7 @@ static inline void red_set_parms(struct red_parms *p,
p->qth_max = qth_max << Wlog; p->qth_max = qth_max << Wlog;
p->Wlog = Wlog; p->Wlog = Wlog;
p->Plog = Plog; p->Plog = Plog;
if (delta < 0) if (delta <= 0)
delta = 1; delta = 1;
p->qth_delta = delta; p->qth_delta = delta;
if (!max_P) { if (!max_P) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment