Re: [Patch net] net_sched: fix a memory leak in atm_tc_init()

2020-07-09 Thread David Miller
From: Cong Wang Date: Wed, 8 Jul 2020 20:13:59 -0700 > When tcf_block_get() fails inside atm_tc_init(), > atm_tc_put() is called to release the qdisc p->link.q. > But the flow->ref prevents it to do so, as the flow->ref > is still zero. > > Fix this by moving the p->link.ref initialization befo

[Patch net] net_sched: fix a memory leak in atm_tc_init()

2020-07-08 Thread Cong Wang
When tcf_block_get() fails inside atm_tc_init(), atm_tc_put() is called to release the qdisc p->link.q. But the flow->ref prevents it to do so, as the flow->ref is still zero. Fix this by moving the p->link.ref initialization before tcf_block_get(). Fixes: 6529eaba33f0 ("net: sched: introduce tcf