summaryrefslogtreecommitdiff
path: root/net/packet
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2021-11-15 20:11:50 +0300
committerDavid S. Miller <davem@davemloft.net>2021-11-16 16:20:45 +0300
commitb3cb764aa1d753cf6a58858f9e2097ba71e8100b (patch)
tree7f2d751f3ec898f8cfb48df852e8beafdb6000a6 /net/packet
parent4199bae10c49e24bc2c5d8c06a68820d56640000 (diff)
downloadlinux-b3cb764aa1d753cf6a58858f9e2097ba71e8100b.tar.xz
net: drop nopreempt requirement on sock_prot_inuse_add()
This is distracting really, let's make this simpler, because many callers had to take care of this by themselves, even if on x86 this adds more code than really needed. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet')
-rw-r--r--net/packet/af_packet.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 46943a18a10d..a1ffdb48cc47 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -3102,9 +3102,7 @@ static int packet_release(struct socket *sock)
sk_del_node_init_rcu(sk);
mutex_unlock(&net->packet.sklist_lock);
- preempt_disable();
sock_prot_inuse_add(net, sk->sk_prot, -1);
- preempt_enable();
spin_lock(&po->bind_lock);
unregister_prot_hook(sk, false);
@@ -3368,9 +3366,7 @@ static int packet_create(struct net *net, struct socket *sock, int protocol,
sk_add_node_tail_rcu(sk, &net->packet.sklist);
mutex_unlock(&net->packet.sklist_lock);
- preempt_disable();
sock_prot_inuse_add(net, &packet_proto, 1);
- preempt_enable();
return 0;
out2: