net_sched: reset pointers to tcf blocks in classful qdiscs' destructors
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Tue, 15 Aug 2017 13:35:21 +0000 (16:35 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Aug 2017 00:16:39 +0000 (17:16 -0700)
commit898904226b5a6dee657f23cf51e385f50da22596
tree1d05b77926120b605ee6ef71f3abe270a49c66e6
parent187e5b3ac84d3421d2de3aca949b2791fbcad554
net_sched: reset pointers to tcf blocks in classful qdiscs' destructors

Traffic filters could keep direct pointers to classes in classful qdisc,
thus qdisc destruction first removes all filters before freeing classes.
Class destruction methods also tries to free attached filters but now
this isn't safe because tcf_block_put() unlike to tcf_destroy_chain()
cannot be called second time.

This patch set class->block to NULL after first tcf_block_put() and
turn second call into no-op.

Fixes: 6529eaba33f0 ("net: sched: introduce tcf block infractructure")
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_atm.c
net/sched/sch_cbq.c
net/sched/sch_hfsc.c
net/sched/sch_htb.c