[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1465792157.7945.145.camel@edumazet-glaptop3.roam.corp.google.com>
Date: Sun, 12 Jun 2016 21:29:17 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: David Miller <davem@...emloft.net>, netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net] net_sched: prio: properly report out of memory
errors
On Sun, 2016-06-12 at 20:45 -0700, Cong Wang wrote:
> On Sun, Jun 12, 2016 at 4:21 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> > + struct Qdisc *child;
> > +
> > + if (q->queues[i] != &noop_qdisc)
> > + continue;
> > +
> > + child = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops,
> > + TC_H_MAKE(sch->handle, i + 1));
> > + if (!child)
> > + return -ENOMEM;
>
> Since this is inside a loop, shouldn't we kfree the previous child
> creations when we fail?
You're right.
prio_init() needs to do the cleanup, as prio_destroy() wont be called
from qdisc_create()
I am testing a fix with fault injection.
Thanks.
Powered by blists - more mailing lists