Bluetooth: Read encryption key size for BR/EDR connections
[firefly-linux-kernel-4.4.55.git] / net / bluetooth / sco.c
index 4322c833e74891d20a627f21e64cdedd67cd806f..688a040c5626ed50a9568211aba1d16541006e88 100644 (file)
@@ -460,11 +460,11 @@ static struct proto sco_proto = {
        .obj_size       = sizeof(struct sco_pinfo)
 };
 
-static struct sock *sco_sock_alloc(struct net *net, struct socket *sock, int proto, gfp_t prio)
+static struct sock *sco_sock_alloc(struct net *net, struct socket *sock, int proto, gfp_t prio, int kern)
 {
        struct sock *sk;
 
-       sk = sk_alloc(net, PF_BLUETOOTH, prio, &sco_proto);
+       sk = sk_alloc(net, PF_BLUETOOTH, prio, &sco_proto, kern);
        if (!sk)
                return NULL;
 
@@ -501,7 +501,7 @@ static int sco_sock_create(struct net *net, struct socket *sock, int protocol,
 
        sock->ops = &sco_sock_ops;
 
-       sk = sco_sock_alloc(net, sock, protocol, GFP_ATOMIC);
+       sk = sco_sock_alloc(net, sock, protocol, GFP_ATOMIC, kern);
        if (!sk)
                return -ENOMEM;
 
@@ -1026,7 +1026,7 @@ static void sco_conn_ready(struct sco_conn *conn)
                bh_lock_sock(parent);
 
                sk = sco_sock_alloc(sock_net(parent), NULL,
-                                   BTPROTO_SCO, GFP_ATOMIC);
+                                   BTPROTO_SCO, GFP_ATOMIC, 0);
                if (!sk) {
                        bh_unlock_sock(parent);
                        sco_conn_unlock(conn);
@@ -1110,7 +1110,7 @@ static void sco_disconn_cfm(struct hci_conn *hcon, __u8 reason)
        sco_conn_del(hcon, bt_to_errno(reason));
 }
 
-int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb)
+void sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb)
 {
        struct sco_conn *conn = hcon->sco_data;
 
@@ -1121,12 +1121,11 @@ int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb)
 
        if (skb->len) {
                sco_recv_frame(conn, skb);
-               return 0;
+               return;
        }
 
 drop:
        kfree_skb(skb);
-       return 0;
 }
 
 static struct hci_cb sco_cb = {