Thread (12 messages) flat view 12 messages, 3 authors, 2016-06-15

Re: [PATCH net] net_sched: prio: properly report out of memory errors

From: Cong Wang <hidden>
Date: 2016-06-13 03:45:36

On Sun, Jun 12, 2016 at 4:21 PM, Eric Dumazet [off-list ref] 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?


+               sch_tree_lock(sch);
+               q->queues[i] = child;
+               sch_tree_unlock(sch);
        }
        return 0;
 }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help