summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_sock.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-05-25 16:46:41 -0700
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-08-11 11:36:50 -0700
commit6bfa273e533d7b25eee3d74e28a7fe8e6a8e7a93 (patch)
treeff166fbbd3010d9691fca37f979c2f2634cf270e /net/bluetooth/hci_sock.c
parent6b42f04e241732158592aac6241822cd6b4a7aae (diff)
downloadlinux-6bfa273e533d7b25eee3d74e28a7fe8e6a8e7a93.tar.gz
linux-6bfa273e533d7b25eee3d74e28a7fe8e6a8e7a93.tar.bz2
linux-6bfa273e533d7b25eee3d74e28a7fe8e6a8e7a93.zip
Bluetooth: Consolidate code around sk_alloc into a helper function
This consolidates code around sk_alloc into bt_sock_alloc which does take care of common initialization. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'net/bluetooth/hci_sock.c')
-rw-r--r--net/bluetooth/hci_sock.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 1d249d839819..9c45586f5818 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -2143,18 +2143,12 @@ static int hci_sock_create(struct net *net, struct socket *sock, int protocol,
sock->ops = &hci_sock_ops;
- sk = sk_alloc(net, PF_BLUETOOTH, GFP_ATOMIC, &hci_sk_proto, kern);
+ sk = bt_sock_alloc(net, sock, &hci_sk_proto, protocol, GFP_ATOMIC,
+ kern);
if (!sk)
return -ENOMEM;
- sock_init_data(sock, sk);
-
- sock_reset_flag(sk, SOCK_ZAPPED);
-
- sk->sk_protocol = protocol;
-
sock->state = SS_UNCONNECTED;
- sk->sk_state = BT_OPEN;
sk->sk_destruct = hci_sock_destruct;
bt_sock_link(&hci_sk_list, sk);