LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 2.6.20 02/10] nfnetlink_log: stop reference leak
@ 2007-02-12  0:38 Michał Mirosław
  0 siblings, 0 replies; only message in thread
From: Michał Mirosław @ 2007-02-12  0:38 UTC (permalink / raw)
  To: netfilter-devel; +Cc: linux-kernel

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

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

--- linux-2.6.20/net/netfilter/nfnetlink_log.c.0	2007-02-11 20:20:27.000000000 +0100
+++ linux-2.6.20/net/netfilter/nfnetlink_log.c	2007-02-11 20:51:57.000000000 +0100
@@ -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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-02-12  9:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-12  0:38 [PATCH 2.6.20 02/10] nfnetlink_log: stop reference leak Michał Mirosław

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).