On 03. 04. 25, 4:07, Kuniyuki Iwashima wrote: ...
--- a/net/core/sock.c +++ b/net/core/sock.c @@ -2324,6 +2324,12 @@ static void __sk_destruct(struct rcu_head *head) __netns_tracker_free(net, &sk->ns_tracker, false); net_passive_dec(net); }
+#if IS_ENABLED(CONFIG_PROVE_LOCKING) && IS_ENABLED(CONFIG_MODULES)
I don't know if this is the right approach at all (it appears not to me), but:
Having this check in random files looks error prone. Perhaps you want to introduce some macro like SOCK_NEEDS_OWNER? Or you introduce sk_put_owner().
- if (sk->sk_owner)
The if is not needed.
module_put(sk->sk_owner);
+#endif
- sk_prot_free(sk->sk_prot_creator, sk); }