diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 51d2cbc8ae1338dbaf042dadde5de48efe9a4c0a..172fdd2105480bdd52af2fe88b71535a02e375a4 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -2716,8 +2716,11 @@ static int nf_tables_newrule(struct net *net, struct sock *nlsk, nf_tables_rule_release(&ctx, rule); err1: for (i = 0; i < n; i++) { - if (info[i].ops != NULL) + if (info[i].ops) { module_put(info[i].ops->type->owner); + if (info[i].ops->type->release_ops) + info[i].ops->type->release_ops(info[i].ops); + } } kvfree(info); return err;