]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nft_ct: fix unpaired nf_connlabels_get/put call
authorLiping Zhang <liping.zhang@spreadtrum.com>
Sat, 16 Jul 2016 06:27:21 +0000 (14:27 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 19 Jul 2016 17:52:03 +0000 (19:52 +0200)
commit50e2990497e1336ba842fe9856a1febfc99edfb4
tree75ef71f76d2da9d44102660d39cfa061b5e7447c
parent51b5d52367a8df0357bf6b517dca5cd6f7ca9ff4
netfilter: nft_ct: fix unpaired nf_connlabels_get/put call

We only get nf_connlabels if the user add ct label set expr successfully,
but we will also put nf_connlabels if the user delete ct lable get expr.
This is mismathced, and will cause ct label expr cannot work properly.

Also, if we init something fail, we should put nf_connlabels back.
Otherwise, we may waste to alloc the memory that will never be used.

Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_ct.c