summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_sock.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-09-21 20:28:11 +0000
committerDavid S. Miller <davem@davemloft.net>2023-10-01 19:09:54 +0100
commit10bbf1652c1cca9819e98d56f3432c56d7a2d229 (patch)
treeab9494c905436ea6f2b9fa1bb979addd2d58da71 /net/bluetooth/l2cap_sock.c
parent06bc3668cc2a6db2831b9086f0e3c6ebda599dba (diff)
downloadlinux-10bbf1652c1cca9819e98d56f3432c56d7a2d229.tar.gz
linux-10bbf1652c1cca9819e98d56f3432c56d7a2d229.tar.bz2
linux-10bbf1652c1cca9819e98d56f3432c56d7a2d229.zip
net: implement lockless SO_PRIORITY
This is a followup of 8bf43be799d4 ("net: annotate data-races around sk->sk_priority"). sk->sk_priority can be read and written without holding the socket lock. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bluetooth/l2cap_sock.c')
-rw-r--r--net/bluetooth/l2cap_sock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 3bdfc3f1e73d..e50d3d102078 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -1615,7 +1615,7 @@ static struct sk_buff *l2cap_sock_alloc_skb_cb(struct l2cap_chan *chan,
return ERR_PTR(-ENOTCONN);
}
- skb->priority = sk->sk_priority;
+ skb->priority = READ_ONCE(sk->sk_priority);
bt_cb(skb)->l2cap.chan = chan;