]> git.baikalelectronics.ru Git - kernel.git/commit
net/sched: act_pedit: fix memory leak when IDR allocation fails
authorDavide Caratti <dcaratti@redhat.com>
Wed, 14 Nov 2018 11:17:25 +0000 (12:17 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 17 Nov 2018 03:53:45 +0000 (19:53 -0800)
commitc7d828f569626cc10567bddc73905cbc8aa0edec
tree82b7b0d49ccbcd5e18f42f2f689ac2e37cf88d65
parent2ee91d1866df6619bafdf8322f3885a185a59086
net/sched: act_pedit: fix memory leak when IDR allocation fails

tcf_idr_check_alloc() can return a negative value, on allocation failures
(-ENOMEM) or IDR exhaustion (-ENOSPC): don't leak keys_ex in these cases.

Fixes: e8163a9d8626 ("net: sched: atomically check-allocate action")
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/act_pedit.c