aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/input.c')
-rw-r--r--net/sctp/input.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c
index f2771375bfc0..2277981559d0 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -322,7 +322,7 @@ int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb)
322 bh_lock_sock(sk); 322 bh_lock_sock(sk);
323 323
324 if (sock_owned_by_user(sk) || !sctp_newsk_ready(sk)) { 324 if (sock_owned_by_user(sk) || !sctp_newsk_ready(sk)) {
325 if (sk_add_backlog(sk, skb, sk->sk_rcvbuf)) 325 if (sk_add_backlog(sk, skb, READ_ONCE(sk->sk_rcvbuf)))
326 sctp_chunk_free(chunk); 326 sctp_chunk_free(chunk);
327 else 327 else
328 backloged = 1; 328 backloged = 1;
@@ -337,7 +337,7 @@ int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb)
337 return 0; 337 return 0;
338 } else { 338 } else {
339 if (!sctp_newsk_ready(sk)) { 339 if (!sctp_newsk_ready(sk)) {
340 if (!sk_add_backlog(sk, skb, sk->sk_rcvbuf)) 340 if (!sk_add_backlog(sk, skb, READ_ONCE(sk->sk_rcvbuf)))
341 return 0; 341 return 0;
342 sctp_chunk_free(chunk); 342 sctp_chunk_free(chunk);
343 } else { 343 } else {
@@ -364,7 +364,7 @@ static int sctp_add_backlog(struct sock *sk, struct sk_buff *skb)
364 struct sctp_ep_common *rcvr = chunk->rcvr; 364 struct sctp_ep_common *rcvr = chunk->rcvr;
365 int ret; 365 int ret;
366 366
367 ret = sk_add_backlog(sk, skb, sk->sk_rcvbuf); 367 ret = sk_add_backlog(sk, skb, READ_ONCE(sk->sk_rcvbuf));
368 if (!ret) { 368 if (!ret) {
369 /* Hold the assoc/ep while hanging on the backlog queue. 369 /* Hold the assoc/ep while hanging on the backlog queue.
370 * This way, we know structures we need will not disappear 370 * This way, we know structures we need will not disappear