From 1c9bfd4a6105986ef5c1620333f92519b99b5d78 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Thu, 11 Sep 2003 04:30:44 -0700 Subject: [PATCH] [BLUETOOTH]: Fix bug in set_sk_owner() changes. --- net/bluetooth/af_bluetooth.c | 1 - net/bluetooth/bnep/sock.c | 3 +++ net/bluetooth/hci_sock.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index 89b1e1cc04fb0..cb1d68d4c98eb 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c @@ -130,7 +130,6 @@ struct sock *bt_sock_alloc(struct socket *sock, int proto, int pi_size, int prio } sock_init_data(sock, sk); - sk_set_owner(sk, THIS_MODULE); INIT_LIST_HEAD(&bt_sk(sk)->accept_q); sk->sk_zapped = 0; diff --git a/net/bluetooth/bnep/sock.c b/net/bluetooth/bnep/sock.c index bcef0a0c48a37..2f0785fa7ffcc 100644 --- a/net/bluetooth/bnep/sock.c +++ b/net/bluetooth/bnep/sock.c @@ -175,6 +175,9 @@ static int bnep_sock_create(struct socket *sock, int protocol) if (!(sk = bt_sock_alloc(sock, PF_BLUETOOTH, 0, GFP_KERNEL))) return -ENOMEM; + + sk_set_owner(sk, THIS_MODULE); + sock->ops = &bnep_sock_ops; sock->state = SS_UNCONNECTED; diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 1953785a0ceae..9679d2ad5656d 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c @@ -587,6 +587,8 @@ static int hci_sock_create(struct socket *sock, int protocol) if (!sk) return -ENOMEM; + sk_set_owner(sk, THIS_MODULE); + sock->state = SS_UNCONNECTED; sk->sk_state = BT_OPEN; -- 2.53.0