netfilter: nf_nat_snmp: Fix panic when snmp_trap_helper fails to register
commitb5ed572a1b7d2d95d7bf1ddcac07c1c8961e405c
authorGao Feng <fgao@ikuai8.com>
Sat, 25 Mar 2017 10:24:36 +0000 (25 18:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Dec 2017 13:23:42 +0000 (25 14:23 +0100)
treefda320658036b7b90f506e924ea707edd853f755
parent01060acf6aabea3ce3e362b0c29eeb6ab5fdfa63
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