diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2012-10-28 14:40:44 +0000 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-10-29 09:59:59 +0100 |
commit | 6229b75d8da5a4eed7bb668de757e252986c2305 (patch) | |
tree | af08d59c44a92032da295afd08d8c044d37fc45b /net/ipv4 | |
parent | 05b4b065a06c3ebacc23ff188e15ea7a278eadc0 (diff) | |
download | linux-6229b75d8da5a4eed7bb668de757e252986c2305.tar.gz linux-6229b75d8da5a4eed7bb668de757e252986c2305.tar.bz2 linux-6229b75d8da5a4eed7bb668de757e252986c2305.zip |
netfilter: nf_nat: use PTR_RET
Use PTR_RET rather than if(IS_ERR(...)) + PTR_ERR
Generated by: coccinelle/api/ptr_ret.cocci
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/netfilter/iptable_nat.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/net/ipv4/netfilter/iptable_nat.c b/net/ipv4/netfilter/iptable_nat.c index 9e0ffaf1d942..8d65b74b7bb9 100644 --- a/net/ipv4/netfilter/iptable_nat.c +++ b/net/ipv4/netfilter/iptable_nat.c @@ -274,9 +274,7 @@ static int __net_init iptable_nat_net_init(struct net *net) return -ENOMEM; net->ipv4.nat_table = ipt_register_table(net, &nf_nat_ipv4_table, repl); kfree(repl); - if (IS_ERR(net->ipv4.nat_table)) - return PTR_ERR(net->ipv4.nat_table); - return 0; + return PTR_RET(net->ipv4.nat_table); } static void __net_exit iptable_nat_net_exit(struct net *net) |