Skip to content

Commit 5c47220

Browse files
Nogah Frankeldavem330
authored andcommitted
net_sched: red: Avoid devision by zero
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5811767 commit 5c47220

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/net/red.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ static inline void red_set_parms(struct red_parms *p,
179179
p->qth_max = qth_max << Wlog;
180180
p->Wlog = Wlog;
181181
p->Plog = Plog;
182-
if (delta < 0)
182+
if (delta <= 0)
183183
delta = 1;
184184
p->qth_delta = delta;
185185
if (!max_P) {

0 commit comments

Comments
 (0)