[11/11] crypto: af_alg - remove redundant initializations of sk_family
diff mbox series

Message ID 20190110201802.82442-12-ebiggers@kernel.org
State Accepted
Delegated to: Herbert Xu
Headers show
Series
  • crypto: misc fixes/cleanups
Related show

Commit Message

Eric Biggers Jan. 10, 2019, 8:18 p.m. UTC
From: Eric Biggers <ebiggers@google.com>

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>
---
 crypto/af_alg.c | 3 ---
 1 file changed, 3 deletions(-)

Patch
diff mbox series

diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index 1dd573a441279..c5937c8127999 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -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;