All of 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
  2007-02-13 12:46 ` Patrick McHardy
  0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread

* Re: [PATCH 2.6.20 02/10] nfnetlink_log: stop reference leak
  2007-02-12  0:38 [PATCH 2.6.20 02/10] nfnetlink_log: stop reference leak Michał Mirosław
@ 2007-02-13 12:46 ` Patrick McHardy
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick McHardy @ 2007-02-13 12:46 UTC (permalink / raw)
  To: Michał Mirosław; +Cc: netfilter-devel, linux-kernel

Micha³ Miros³aw wrote:
> 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.

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

end of thread, other threads:[~2007-02-13 12:46 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:38 [PATCH 2.6.20 02/10] nfnetlink_log: stop reference leak Michał Mirosław
2007-02-13 12:46 ` Patrick McHardy

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.