Skip to content

Commit

Permalink
[NET]: Remove bogus zero_it argument from sk_alloc
Browse files Browse the repository at this point in the history
At this point nobody calls the sk_alloc(() with zero_it == 0,
so remove unneeded checks from it.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Nov 1, 2007
1 parent 8fd1d17 commit 154adbc
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,21 +931,16 @@ struct sock *sk_alloc(struct net *net, int family, gfp_t priority,
{
struct sock *sk;

if (zero_it)
priority |= __GFP_ZERO;

sk = sk_prot_alloc(prot, priority, family);
sk = sk_prot_alloc(prot, priority | __GFP_ZERO, family);
if (sk) {
if (zero_it) {
sk->sk_family = family;
/*
* See comment in struct sock definition to understand
* why we need sk_prot_creator -acme
*/
sk->sk_prot = sk->sk_prot_creator = prot;
sock_lock_init(sk);
sk->sk_net = get_net(net);
}
sk->sk_family = family;
/*
* See comment in struct sock definition to understand
* why we need sk_prot_creator -acme
*/
sk->sk_prot = sk->sk_prot_creator = prot;
sock_lock_init(sk);
sk->sk_net = get_net(net);
}

return sk;
Expand Down

0 comments on commit 154adbc

Please sign in to comment.