Using sk_set_owner and having THIS_MODULE in the struct proto_ops registered
with the core.
atomic_inc(&unix_nr_socks);
sock_init_data(sock,sk);
+ sk_set_owner(sk, THIS_MODULE);
sk->write_space = unix_write_space;
struct proto_ops unix_stream_ops = {
.family = PF_UNIX,
-
+ .owner = THIS_MODULE,
.release = unix_release,
.bind = unix_bind,
.connect = unix_stream_connect,
struct proto_ops unix_dgram_ops = {
.family = PF_UNIX,
-
+ .owner = THIS_MODULE,
.release = unix_release,
.bind = unix_bind,
.connect = unix_dgram_connect,