[NET_SCHED]: Fix qdisc_restart return value when dequeue is empty

This change “[NET_SCHED]: Fix qdisc_restart return value when dequeue is empty” (commit 36247f5) in Linux kernel is authored by Herbert Xu <herbert [at] gondor.apana.org.au> on Wed May 23 14:30:44 2007 -0700.

Description of "[NET_SCHED]: Fix qdisc_restart return value when dequeue is empty"

The change “[NET_SCHED]: Fix qdisc_restart return value when dequeue is empty” introduces changes as follows.

[NET_SCHED]: Fix qdisc_restart return value when dequeue is empty

My previous patch that changed the return value of qdisc_restart
incorrectly made the case where dequeue returns empty continue
processing packets.

This patch is based on diagnosis and fix by Patrick McHardy.

Reported-and-debugged-by: Anant Nitya <kernel@prachanda.info>

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>

Linux kernel releases containing commit 36247f5

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "[NET_SCHED]: Fix qdisc_restart return value when dequeue is empty"

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 net/sched/sch_generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index f28bb2dc58d0..cbefe225581e 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -169,8 +169,8 @@ static inline int qdisc_restart(struct net_device *dev)
 		else
 			q->ops->requeue(skb, q);
 		netif_schedule(dev);
-		return 0;
 	}
+	return 0;
 
 out:
 	BUG_ON((int) q->q.qlen < 0);

The commit for this change in Linux stable tree is 36247f5 (patch).

Last modified: 2020/02/11