aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/netfilter/iptable_raw.c
diff options
context:
space:
mode:
authorJean Sacren <sakiwit@gmail.com>2012-08-19 15:11:32 +0000
committerPablo Neira Ayuso <pablo@netfilter.org>2012-08-22 19:17:38 +0200
commit90efbed18a30d78145419cdbd44f9ec152efeb16 (patch)
tree8724b522e0b6152856baad0a407573a917bbf6da /net/ipv4/netfilter/iptable_raw.c
parentnetfilter: replace list_for_each_continue_rcu with new interface (diff)
downloadlinux-dev-90efbed18a30d78145419cdbd44f9ec152efeb16.tar.xz
linux-dev-90efbed18a30d78145419cdbd44f9ec152efeb16.zip
netfilter: remove unnecessary goto statement for error recovery
Usually it's a good practice to use goto statement for error recovery when initializing the module. This approach could be an overkill if: 1) there is only one fail case; 2) success and failure use the same return statement. For a cleaner approach, remove the unnecessary goto statement and directly implement error recovery. Signed-off-by: Jean Sacren <sakiwit@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/ipv4/netfilter/iptable_raw.c')
-rw-r--r--net/ipv4/netfilter/iptable_raw.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/net/ipv4/netfilter/iptable_raw.c b/net/ipv4/netfilter/iptable_raw.c
index b21e2191e2f5..03d9696d3c6e 100644
--- a/net/ipv4/netfilter/iptable_raw.c
+++ b/net/ipv4/netfilter/iptable_raw.c
@@ -73,14 +73,10 @@ static int __init iptable_raw_init(void)
rawtable_ops = xt_hook_link(&packet_raw, iptable_raw_hook);
if (IS_ERR(rawtable_ops)) {
ret = PTR_ERR(rawtable_ops);
- goto cleanup_table;
+ unregister_pernet_subsys(&iptable_raw_net_ops);
}
return ret;
-
- cleanup_table:
- unregister_pernet_subsys(&iptable_raw_net_ops);
- return ret;
}
static void __exit iptable_raw_fini(void)