summaryrefslogtreecommitdiff
path: root/net/sched
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2016-06-09 00:23:01 +0300
committerDavid S. Miller <davem@davemloft.net>2016-06-09 08:41:38 +0300
commit9b15350f0d5c401c02eca15c4e6ca0603cff1a41 (patch)
tree46e9aa1152e7e6b7f9150ff41070e023a83e7a70 /net/sched
parent0a46baaf634663d28038fc137239b71bf5385e5a (diff)
downloadlinux-9b15350f0d5c401c02eca15c4e6ca0603cff1a41.tar.xz
qfq: don't leak skb if kzalloc fails
When we need to create a new aggregate to enqueue the skb we call kzalloc. If that fails we returned ENOBUFS without freeing the skb. Spotted during code review. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_qfq.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c
index 8d2d8d953432..f18857febdad 100644
--- a/net/sched/sch_qfq.c
+++ b/net/sched/sch_qfq.c
@@ -1235,8 +1235,10 @@ static int qfq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
cl->agg->lmax, qdisc_pkt_len(skb), cl->common.classid);
err = qfq_change_agg(sch, cl, cl->agg->class_weight,
qdisc_pkt_len(skb));
- if (err)
- return err;
+ if (err) {
+ cl->qstats.drops++;
+ return qdisc_drop(skb, sch);
+ }
}
err = qdisc_enqueue(skb, cl->qdisc);