net: sched: fix clsact init error path
authorJiri Pirko <jiri@mellanox.com>
Fri, 15 Dec 2017 11:40:12 +0000 (12:40 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Dec 2017 20:43:12 +0000 (15:43 -0500)
commit343723dd51ef1025a860e54df9472b5ba21ee3d9
tree6611f40a0342dca4fad113db640e0371471f8f62
parentc05fad5713b81b049ec6ac4eb2d304030b1efdce
net: sched: fix clsact init error path

Since in qdisc_create, the destroy op is called when init fails, we
don't do cleanup in init and leave it up to destroy.
This fixes use-after-free when trying to put already freed block.

Fixes: 6e40cf2d4dee ("net: sched: use extended variants of block_get/put in ingress and clsact qdiscs")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_api.c
net/sched/sch_ingress.c