- return err;
-}
-
-struct sock *bt_sock_alloc(struct socket *sock, int proto, int pi_size, int prio)
-{
- struct sock *sk;
- void *pi;
-
- sk = sk_alloc(PF_BLUETOOTH, prio, sizeof(struct bt_sock), bt_sock_cache);
- if (!sk)
- return NULL;
-
- if (pi_size) {
- pi = kmalloc(pi_size, prio);
- if (!pi) {
- sk_free(sk);
- return NULL;
- }
- memset(pi, 0, pi_size);
- sk->sk_protinfo = pi;
- }