lkml.org 
[lkml]   [2012]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] netfilter: 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>
---

net/ipv4/netfilter/iptable_nat.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

--- linux-next.orig/net/ipv4/netfilter/iptable_nat.c 2012-10-23 09:44:52.577430992 +0800
+++ linux-next/net/ipv4/netfilter/iptable_nat.c 2012-10-29 08:38:43.063222201 +0800
@@ -274,9 +274,7 @@ static int __net_init iptable_nat_net_in
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)

\
 
 \ /
  Last update: 2012-10-29 02:21    [W:0.035 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site