Commit 5c472203 authored by Nogah Frankel's avatar Nogah Frankel Committed by David S. Miller

net_sched: red: Avoid devision by zero

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>
parent 58117672
......@@ -179,7 +179,7 @@ static inline void red_set_parms(struct red_parms *p,
p->qth_max = qth_max << Wlog;
p->Wlog = Wlog;
p->Plog = Plog;
if (delta < 0)
if (delta <= 0)
delta = 1;
p->qth_delta = delta;
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