diff options
author | Jakub Kicinski <kuba@kernel.org> | 2022-10-24 23:44:11 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-10-24 23:44:11 +0300 |
commit | 96917bb3a377e1ed103fd5c420a95e5fb25ca104 (patch) | |
tree | 59e0ef14e8707efba95d2f795742ba69a03bc8d0 /net/core/net_namespace.c | |
parent | 86d6f77a3cce1189ab7c31e52e4d47ca58e7a601 (diff) | |
parent | 337a0a0b63f1c30195733eaacf39e4310a592a68 (diff) | |
download | linux-96917bb3a377e1ed103fd5c420a95e5fb25ca104.tar.xz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
include/linux/net.h
a5ef058dc4d9 ("net: introduce and use custom sockopt socket flag")
e993ffe3da4b ("net: flag sockets supporting msghdr originated zerocopy")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/net_namespace.c')
-rw-r--r-- | net/core/net_namespace.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 12c68edf7682..5581d22cc191 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -117,6 +117,7 @@ static int net_assign_generic(struct net *net, unsigned int id, void *data) static int ops_init(const struct pernet_operations *ops, struct net *net) { + struct net_generic *ng; int err = -ENOMEM; void *data = NULL; @@ -135,7 +136,13 @@ static int ops_init(const struct pernet_operations *ops, struct net *net) if (!err) return 0; + if (ops->id && ops->size) { cleanup: + ng = rcu_dereference_protected(net->gen, + lockdep_is_held(&pernet_ops_rwsem)); + ng->ptr[*ops->id] = NULL; + } + kfree(data); out: |