netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.20 05/10] nfnetlink_log: micro-optimization for inst==NULL in nfulnl_recv_config()
@ 2007-02-12  0:39 Michał Mirosław
  2007-02-13 12:47 ` Patrick McHardy
  0 siblings, 1 reply; 2+ messages in thread
From: Michał Mirosław @ 2007-02-12  0:39 UTC (permalink / raw)
  To: netfilter-devel; +Cc: linux-kernel

Simple micro-optimization: don't call instance_put() on known NULL pointers.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>

--- linux-2.6.20/net/netfilter/nfnetlink_log.c.3	2007-02-11 20:46:33.000000000 +0100
+++ linux-2.6.20/net/netfilter/nfnetlink_log.c	2007-02-11 20:46:26.000000000 +0100
@@ -814,13 +814,13 @@ nfulnl_recv_config(struct sock *ctnl, st
 					       NETLINK_CB(skb).pid);
 			if (!inst) {
 				ret = -EINVAL;
-				goto out_put;
+				goto out_null;
 			}
 			break;
 		case NFULNL_CFG_CMD_UNBIND:
 			if (!inst) {
 				ret = -ENODEV;
-				goto out_put;
+				goto out_null;
 			}
 
 			if (inst->peer_pid != NETLINK_CB(skb).pid) {
@@ -850,7 +850,7 @@ nfulnl_recv_config(struct sock *ctnl, st
 				"group=%u pid=%u =>ENOENT\n",
 				group_num, NETLINK_CB(skb).pid);
 			ret = -ENOENT;
-			goto out_put;
+			goto out_null;
 		}
 
 		if (inst->peer_pid != NETLINK_CB(skb).pid) {
@@ -897,6 +897,7 @@ nfulnl_recv_config(struct sock *ctnl, st
 
 out_put:
 	instance_put(inst);
+out_null:
 	return ret;
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-02-13 12:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-12  0:39 [PATCH 2.6.20 05/10] nfnetlink_log: micro-optimization for inst==NULL in nfulnl_recv_config() Michał Mirosław
2007-02-13 12:47 ` Patrick McHardy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).