crypto: af_alg - remove redundant initializations of sk_family
authorEric Biggers <ebiggers@google.com>
Thu, 10 Jan 2019 20:18:02 +0000 (12:18 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 18 Jan 2019 10:43:43 +0000 (18:43 +0800)
sk_alloc() already sets sock::sk_family to PF_ALG which is passed as the
'family' argument, so there's no need to set it again.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/af_alg.c

index 1dd573a..c5937c8 100644 (file)
@@ -302,8 +302,6 @@ int af_alg_accept(struct sock *sk, struct socket *newsock, bool kern)
        if (err)
                goto unlock;
 
-       sk2->sk_family = PF_ALG;
-
        if (nokey || !ask->refcnt++)
                sock_hold(sk);
        ask->nokey_refcnt += nokey;
@@ -380,7 +378,6 @@ static int alg_create(struct net *net, struct socket *sock, int protocol,
        sock->ops = &alg_proto_ops;
        sock_init_data(sock, sk);
 
-       sk->sk_family = PF_ALG;
        sk->sk_destruct = alg_sock_destruct;
 
        return 0;