diff mbox

netfilter 01/03: nf_log regression fix

Message ID 20090416171622.11406.71514.sendpatchset@x2.localnet
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Patrick McHardy April 16, 2009, 5:16 p.m. UTC
commit b6f0a3652ea9d2296fdc98c3b2c96603be611c4d
Author: Eric Dumazet <dada1@cosmosbay.com>
Date:   Wed Apr 15 12:16:19 2009 +0200

    netfilter: nf_log regression fix
    
    commit ca735b3aaa945626ba65a3e51145bfe4ecd9e222
    'netfilter: use a linked list of loggers'
    introduced an array of list_head in "struct nf_logger", but
    forgot to initialize it in nf_log_register(). This resulted
    in oops when calling nf_log_unregister() at module unload time.
    
    Reported-and-tested-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
    Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
    Acked-by: Eric Leblond <eric@inl.fr>
    Signed-off-by: Patrick McHardy <kaber@trash.net>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c
index 8bb998f..beb3731 100644
--- a/net/netfilter/nf_log.c
+++ b/net/netfilter/nf_log.c
@@ -36,10 +36,14 @@  static struct nf_logger *__find_logger(int pf, const char *str_logger)
 int nf_log_register(u_int8_t pf, struct nf_logger *logger)
 {
 	const struct nf_logger *llog;
+	int i;
 
 	if (pf >= ARRAY_SIZE(nf_loggers))
 		return -EINVAL;
 
+	for (i = 0; i < ARRAY_SIZE(logger->list); i++)
+		INIT_LIST_HEAD(&logger->list[i]);
+
 	mutex_lock(&nf_log_mutex);
 
 	if (pf == NFPROTO_UNSPEC) {