netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net-next] net: sched: atm: destroy main filter chain
@ 2017-03-24 13:39 Jiri Pirko
  2017-03-24 17:46 ` Cong Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Pirko @ 2017-03-24 13:39 UTC (permalink / raw)
  To: netdev; +Cc: davem, jhs, mlxsw

From: Jiri Pirko <jiri@mellanox.com>

In atm_tc_destroy, the flow qdisc filter chains are destroyed. However
the main chain is not. So fix this memory and reference leak.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
Sending this for net-next because this is present at least from the
beginning of git epoch. Feel free to apply on -net, however I don't have
"Fixes: " :)
---
 net/sched/sch_atm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c
index 2209c2d..56421da 100644
--- a/net/sched/sch_atm.c
+++ b/net/sched/sch_atm.c
@@ -560,6 +560,9 @@ static void atm_tc_destroy(struct Qdisc *sch)
 	struct atm_flow_data *flow, *tmp;
 
 	pr_debug("atm_tc_destroy(sch %p,[qdisc %p])\n", sch, p);
+
+	tcf_destroy_chain(&p->link.filter_list);
+
 	list_for_each_entry(flow, &p->flows, list)
 		tcf_destroy_chain(&flow->filter_list);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch net-next] net: sched: atm: destroy main filter chain
  2017-03-24 13:39 [patch net-next] net: sched: atm: destroy main filter chain Jiri Pirko
@ 2017-03-24 17:46 ` Cong Wang
  2017-03-24 17:55   ` Jiri Pirko
  0 siblings, 1 reply; 3+ messages in thread
From: Cong Wang @ 2017-03-24 17:46 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: Linux Kernel Network Developers, David Miller, Jamal Hadi Salim,
	mlxsw

On Fri, Mar 24, 2017 at 6:39 AM, Jiri Pirko <jiri@resnulli.us> wrote:
> From: Jiri Pirko <jiri@mellanox.com>
>
> In atm_tc_destroy, the flow qdisc filter chains are destroyed. However
> the main chain is not. So fix this memory and reference leak.

Are you sure? 'link' is on the 'flows' already according
to this comment:

struct atm_qdisc_data {
        struct atm_flow_data    link;           /* unclassified skbs go here */
        struct list_head        flows;          /* NB: "link" is also on this
                                                   list */
        struct tasklet_struct   task;           /* dequeue tasklet */
};

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch net-next] net: sched: atm: destroy main filter chain
  2017-03-24 17:46 ` Cong Wang
@ 2017-03-24 17:55   ` Jiri Pirko
  0 siblings, 0 replies; 3+ messages in thread
From: Jiri Pirko @ 2017-03-24 17:55 UTC (permalink / raw)
  To: Cong Wang
  Cc: Linux Kernel Network Developers, David Miller, Jamal Hadi Salim,
	mlxsw

Fri, Mar 24, 2017 at 06:46:55PM CET, xiyou.wangcong@gmail.com wrote:
>On Fri, Mar 24, 2017 at 6:39 AM, Jiri Pirko <jiri@resnulli.us> wrote:
>> From: Jiri Pirko <jiri@mellanox.com>
>>
>> In atm_tc_destroy, the flow qdisc filter chains are destroyed. However
>> the main chain is not. So fix this memory and reference leak.
>
>Are you sure? 'link' is on the 'flows' already according

Ah. You are correct. Scratch this. Thanks.

Btw, I think that in atm_tc_change:
list_add(&flow->list, &p->link.list);
should be:
list_add(&flow->list, &p->flows);



>to this comment:
>
>struct atm_qdisc_data {
>        struct atm_flow_data    link;           /* unclassified skbs go here */
>        struct list_head        flows;          /* NB: "link" is also on this
>                                                   list */
>        struct tasklet_struct   task;           /* dequeue tasklet */
>};

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-24 17:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-24 13:39 [patch net-next] net: sched: atm: destroy main filter chain Jiri Pirko
2017-03-24 17:46 ` Cong Wang
2017-03-24 17:55   ` Jiri Pirko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).