diff options
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 6ee2ed104a83..b66f607fcb96 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -908,10 +908,12 @@ struct sock *sk_alloc(struct net *net, int family, gfp_t priority, | |||
908 | { | 908 | { |
909 | struct sock *sk; | 909 | struct sock *sk; |
910 | 910 | ||
911 | if (zero_it) | ||
912 | priority |= __GFP_ZERO; | ||
913 | |||
911 | sk = sk_prot_alloc(prot, priority); | 914 | sk = sk_prot_alloc(prot, priority); |
912 | if (sk) { | 915 | if (sk) { |
913 | if (zero_it) { | 916 | if (zero_it) { |
914 | memset(sk, 0, prot->obj_size); | ||
915 | sk->sk_family = family; | 917 | sk->sk_family = family; |
916 | /* | 918 | /* |
917 | * See comment in struct sock definition to understand | 919 | * See comment in struct sock definition to understand |