diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 5be4cdb6590b488cea4daa225c03b297cdf43afd..51d2cbc8ae1338dbaf042dadde5de48efe9a4c0a 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -2113,9 +2113,11 @@ static int nf_tables_newexpr(const struct nft_ctx *ctx, static void nf_tables_expr_destroy(const struct nft_ctx *ctx, struct nft_expr *expr) { + const struct nft_expr_type *type = expr->ops->type; + if (expr->ops->destroy) expr->ops->destroy(ctx, expr); - module_put(expr->ops->type->owner); + module_put(type->owner); } struct nft_expr *nft_expr_init(const struct nft_ctx *ctx,