|
@@ -1021,7 +1021,8 @@ static int nf_tables_deltable(struct net *net, struct sock *nlsk,
|
|
|
|
|
|
static void nf_tables_table_destroy(struct nft_ctx *ctx)
|
|
static void nf_tables_table_destroy(struct nft_ctx *ctx)
|
|
{
|
|
{
|
|
- BUG_ON(ctx->table->use > 0);
|
|
|
|
|
|
+ if (WARN_ON(ctx->table->use > 0))
|
|
|
|
+ return;
|
|
|
|
|
|
rhltable_destroy(&ctx->table->chains_ht);
|
|
rhltable_destroy(&ctx->table->chains_ht);
|
|
kfree(ctx->table->name);
|
|
kfree(ctx->table->name);
|
|
@@ -1428,7 +1429,8 @@ static void nf_tables_chain_destroy(struct nft_ctx *ctx)
|
|
{
|
|
{
|
|
struct nft_chain *chain = ctx->chain;
|
|
struct nft_chain *chain = ctx->chain;
|
|
|
|
|
|
- BUG_ON(chain->use > 0);
|
|
|
|
|
|
+ if (WARN_ON(chain->use > 0))
|
|
|
|
+ return;
|
|
|
|
|
|
/* no concurrent access possible anymore */
|
|
/* no concurrent access possible anymore */
|
|
nf_tables_chain_free_chain_rules(chain);
|
|
nf_tables_chain_free_chain_rules(chain);
|
|
@@ -7243,7 +7245,8 @@ int __nft_release_basechain(struct nft_ctx *ctx)
|
|
{
|
|
{
|
|
struct nft_rule *rule, *nr;
|
|
struct nft_rule *rule, *nr;
|
|
|
|
|
|
- BUG_ON(!nft_is_base_chain(ctx->chain));
|
|
|
|
|
|
+ if (WARN_ON(!nft_is_base_chain(ctx->chain)))
|
|
|
|
+ return 0;
|
|
|
|
|
|
nf_tables_unregister_hook(ctx->net, ctx->chain->table, ctx->chain);
|
|
nf_tables_unregister_hook(ctx->net, ctx->chain->table, ctx->chain);
|
|
list_for_each_entry_safe(rule, nr, &ctx->chain->rules, list) {
|
|
list_for_each_entry_safe(rule, nr, &ctx->chain->rules, list) {
|