Skip to content

Commit

Permalink
[NETFILTER]: x_tables: move table->lock initialization
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Dmitry Mishin <dim@openvz.org>
Signed-off-by: Kirill Korotaev <dev@openvz.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dmitry Mishin authored and David S. Miller committed Apr 25, 2006
1 parent e4a79ef commit 91536b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/x_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ int xt_register_table(struct xt_table *table,

/* Simplifies replace_table code. */
table->private = bootstrap;
rwlock_init(&table->lock);
if (!xt_replace_table(table, 0, newinfo, &ret))
goto unlock;

Expand All @@ -538,7 +539,6 @@ int xt_register_table(struct xt_table *table,
/* save number of initial entries */
private->initial_entries = private->number;

rwlock_init(&table->lock);
list_prepend(&xt[table->af].tables, table);

ret = 0;
Expand Down

0 comments on commit 91536b7

Please sign in to comment.