]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: act_ife: always release ife action on init error
authorVlad Buslov <vladbu@mellanox.com>
Tue, 14 Aug 2018 17:29:56 +0000 (20:29 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Aug 2018 19:12:12 +0000 (12:12 -0700)
commit1d0f13f16ea74a81a863b18c961a7d1c4da8b3ac
treee032ecc8fe44d5c4534999e5bdd97e1cced66080
parent1ac79c586a013c09cbb59c821ef0f05c961ca002
net: sched: act_ife: always release ife action on init error

Action init API was changed to always take reference to action, even when
overwriting existing action. Substitute conditional action release, which
was executed only if action is newly created, with unconditional release in
tcf_ife_init() error handling code to prevent double free or memory leak in
case of overwrite.

Fixes: 1da80b4ca12e ("net: sched: don't release reference on action overwrite")
Reported-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/act_ife.c