|
@@ -2457,7 +2457,7 @@ err:
|
|
|
static void nf_tables_rule_destroy(const struct nft_ctx *ctx,
|
|
|
struct nft_rule *rule)
|
|
|
{
|
|
|
- struct nft_expr *expr;
|
|
|
+ struct nft_expr *expr, *next;
|
|
|
|
|
|
/*
|
|
|
* Careful: some expressions might not be initialized in case this
|
|
@@ -2465,8 +2465,9 @@ static void nf_tables_rule_destroy(const struct nft_ctx *ctx,
|
|
|
*/
|
|
|
expr = nft_expr_first(rule);
|
|
|
while (expr != nft_expr_last(rule) && expr->ops) {
|
|
|
+ next = nft_expr_next(expr);
|
|
|
nf_tables_expr_destroy(ctx, expr);
|
|
|
- expr = nft_expr_next(expr);
|
|
|
+ expr = next;
|
|
|
}
|
|
|
kfree(rule);
|
|
|
}
|