net: sched: act_ct: fix possible refcount leak in tcf_ct_init()
authorHangyu Hua <hbh25y@gmail.com>
Fri, 23 Sep 2022 02:00:46 +0000 (10:00 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Oct 2022 08:39:42 +0000 (10:39 +0200)
commite99c7a61d89e4491389da4745a327a91dbf78655
treef9a0e7b9371ae44da54f8fa324bf515fedb75e99
parent815381aeff9527fa2445a0eb70171997fe8aeda9
net: sched: act_ct: fix possible refcount leak in tcf_ct_init()

[ Upstream commit 6e23ec0ba92d426c77a73a9ccab16346e5e0ef49 ]

nf_ct_put need to be called to put the refcount got by tcf_ct_fill_params
to avoid possible refcount leak when tcf_ct_flow_table_get fails.

Fixes: c34b961a2492 ("net/sched: act_ct: Create nf flow table per zone")
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
Link: https://lore.kernel.org/r/20220923020046.8021-1-hbh25y@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sched/act_ct.c