Skip to contentSkip to conversation

table->lock initialization move

PATCH Applied Dmitry Mishin 2 participants 2 messages Apr 17, 2006 – Apr 20, 2006

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

PATCH 1/1 table->lock initialization move

xt_table->lock should be initialized before xt_replace_table() call, which uses it. This patch removes strict requirement, that table should define lock before registering.

Signature · 2 lines
Thanks,
Dmitry.
net/netfilter/x_tables.c +1 -1
index 00cf0a4..17abf60 100644
@@ -529,6 +529,7 @@ int xt_register_table(struct xt_table *t
 
 	/* Simplifies replace_table code. */
 	table->private = bootstrap;
+	rwlock_init(&table->lock);
 	if (!xt_replace_table(table, 0, newinfo, &ret))
 		goto unlock;
 
@@ -538,7 +539,6 @@ int xt_register_table(struct xt_table *t
 	/* save number of initial entries */
 	private->initial_entries = private->number;
 
-	rwlock_init(&table->lock);
 	list_prepend(&xt[table->af].tables, table);
 
 	ret = 0;
#1 lore raw
Quoted 3 lines · Dmitry Mishin

xt_table->lock should be initialized before xt_replace_table() call, which uses it. This patch removes strict requirement, that table should define lock before registering.

Applied, thanks.