netfilter: nf_nat_snmp: Fix panic when snmp_trap_helper fails to register
authorGao Feng <fgao@ikuai8.com>
Sat, 25 Mar 2017 10:24:36 +0000 (18:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Dec 2017 13:22:13 +0000 (14:22 +0100)
commit17b1ff10a1fc73967a420cc2c6f9819980bc120a
tree6b8b4865827f802354a91106d031ee756f664e36
parent7c9316d2f263d616bdf88e8b9fbfd76096236d7c
netfilter: nf_nat_snmp: Fix panic when snmp_trap_helper fails to register

[ Upstream commit 75c689dca98851d65ef5a27e5ce26b625b68751c ]

In the commit 93557f53e1fb ("netfilter: nf_conntrack: nf_conntrack snmp
helper"), the snmp_helper is replaced by nf_nat_snmp_hook. So the
snmp_helper is never registered. But it still tries to unregister the
snmp_helper, it could cause the panic.

Now remove the useless snmp_helper and the unregister call in the
error handler.

Fixes: 93557f53e1fb ("netfilter: nf_conntrack: nf_conntrack snmp helper")
Signed-off-by: Gao Feng <fgao@ikuai8.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/netfilter/nf_nat_snmp_basic.c