o af_key: use revised net module infrastructure

Using sk_set_owner and having THIS_MODULE in the struct proto_ops registered
with the core.
parent 99d06755
...@@ -155,6 +155,7 @@ static int pfkey_create(struct socket *sock, int protocol) ...@@ -155,6 +155,7 @@ static int pfkey_create(struct socket *sock, int protocol)
sock->ops = &pfkey_ops; sock->ops = &pfkey_ops;
sock_init_data(sock, sk); sock_init_data(sock, sk);
sk_set_owner(sk, THIS_MODULE);
err = -ENOMEM; err = -ENOMEM;
pfk = pfkey_sk(sk) = kmalloc(sizeof(*pfk), GFP_KERNEL); pfk = pfkey_sk(sk) = kmalloc(sizeof(*pfk), GFP_KERNEL);
...@@ -2761,7 +2762,7 @@ static int pfkey_recvmsg(struct kiocb *kiocb, ...@@ -2761,7 +2762,7 @@ static int pfkey_recvmsg(struct kiocb *kiocb,
static struct proto_ops pfkey_ops = { static struct proto_ops pfkey_ops = {
.family = PF_KEY, .family = PF_KEY,
.owner = THIS_MODULE,
/* Operations that make no sense on pfkey sockets. */ /* Operations that make no sense on pfkey sockets. */
.bind = sock_no_bind, .bind = sock_no_bind,
.connect = sock_no_connect, .connect = sock_no_connect,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment