[NETFILTER]: x_tables: move table->lock initialization

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>

authored by Dmitry Mishin and committed by David S. Miller 91536b7a e4a79ef8

+1 -1
+1 -1
net/netfilter/x_tables.c
··· 529 530 /* Simplifies replace_table code. */ 531 table->private = bootstrap; 532 if (!xt_replace_table(table, 0, newinfo, &ret)) 533 goto unlock; 534 ··· 539 /* save number of initial entries */ 540 private->initial_entries = private->number; 541 542 - rwlock_init(&table->lock); 543 list_prepend(&xt[table->af].tables, table); 544 545 ret = 0;
··· 529 530 /* Simplifies replace_table code. */ 531 table->private = bootstrap; 532 + rwlock_init(&table->lock); 533 if (!xt_replace_table(table, 0, newinfo, &ret)) 534 goto unlock; 535 ··· 538 /* save number of initial entries */ 539 private->initial_entries = private->number; 540 541 list_prepend(&xt[table->af].tables, table); 542 543 ret = 0;