Skip to contentSkip to conversation

nfnetlink_log: micro-optimization for inst==NULL in nfulnl_recv_config()

PATCH Applied Michał Mirosław 2 participants 2 messages Feb 12, 2007 – Feb 13, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 5/10 nfnetlink_log: micro-optimization for inst==NULL in nfulnl_recv_config()

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

net/netfilter/nfnetlink_log.c renamed from net/netfilter/nfnetlink_log.c.3 +4 -3
@@ -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;
 }
 
#1 lore raw
Quoted 1 line · Micha³ Miros³aw

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

Applied.