Skip to content

Commit

Permalink
net_sched: red: Avoid devision by zero
Browse files Browse the repository at this point in the history
Do not allow delta value to be zero since it is used as a divisor.

Fixes: 8af2a21 ("sch_red: Adaptative RED AQM")
Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nogah Frankel authored and David S. Miller committed Dec 5, 2017
1 parent 5811767 commit 5c47220
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/net/red.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5c47220

Please sign in to comment.