Skip to contentSkip to conversation

nfnetlink_log: stop reference leak

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 2/10 nfnetlink_log: stop reference leak

Stop reference leaking in nfulnl_log_packet(). If we start a timer we are already taking another reference.

net/netfilter/nfnetlink_log.c renamed from net/netfilter/nfnetlink_log.c.0 +4 -3
@@ -705,15 +705,16 @@ nfulnl_log_packet(unsigned int pf,
 		inst->timer.expires = jiffies + (inst->flushtimeout*HZ/100);
 		add_timer(&inst->timer);
 	}
-	spin_unlock_bh(&inst->lock);
 
+unlock_and_release:
+	spin_unlock_bh(&inst->lock);
+	instance_put(inst);
 	return;
 
 alloc_failure:
-	spin_unlock_bh(&inst->lock);
-	instance_put(inst);
 	UDEBUG("error allocating skb\n");
 	/* FIXME: statistics */
+	goto unlock_and_release;
 }
 
 static int
#1 lore raw
Quoted 2 lines · Micha³ Miros³aw

Stop reference leaking in nfulnl_log_packet(). If we start a timer we are already taking another reference.

Good catch, applied. I'll forward this one to -stable.