-static struct sock *rose_alloc_sock(void)
-{
- rose_cb *rose;
- struct sock *sk = sk_alloc(PF_ROSE, GFP_ATOMIC, 1, NULL);
-
- if (!sk)
- goto out;
-
- rose = sk->sk_protinfo = kmalloc(sizeof(*rose), GFP_ATOMIC);
- if (!rose)
- goto frees;
-
- memset(rose, 0x00, sizeof(*rose));
- rose->sk = sk;
-out:
- return sk;
-frees:
- sk_free(sk);
- sk = NULL;
- goto out;
-}
-