Message ID | 20230815223011.7019-9-fw@strlen.de (mailing list archive) |
---|---|
State | Accepted |
Commit | 02c6c24402bf1c1e986899c14ba22a10b510916b |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net,1/9] netfilter: nf_tables: fix false-positive lockdep splat | expand |
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 8ac4dd8be1a2..3e841e45f2c0 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -9481,9 +9481,14 @@ struct nft_trans_gc *nft_trans_gc_alloc(struct nft_set *set, if (!trans) return NULL; + trans->net = maybe_get_net(net); + if (!trans->net) { + kfree(trans); + return NULL; + } + refcount_inc(&set->refs); trans->set = set; - trans->net = get_net(net); trans->seq = gc_seq; return trans;