All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fengguang Wu <fengguang.wu@intel.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Patrick McHardy <kaber@trash.net>,
	netfilter-devel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] netfilter: use PTR_RET
Date: Mon, 29 Oct 2012 08:40:44 +0800	[thread overview]
Message-ID: <20121029004044.GA12982@localhost> (raw)

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)

             reply	other threads:[~2012-10-29  0:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-29  0:40 Fengguang Wu [this message]
2012-10-29  0:55 ` [PATCH] netfilter: ipv6: use PTR_RET Fengguang Wu
2012-10-29  9:03 ` [PATCH] netfilter: " Pablo Neira Ayuso
2012-10-29  9:13   ` Fengguang Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121029004044.GA12982@localhost \
    --to=fengguang.wu@intel.com \
    --cc=kaber@trash.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.