diff options
author | Ingo Molnar <mingo@kernel.org> | 2019-11-11 08:34:59 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-11-11 08:34:59 +0100 |
commit | 6d5a763c303bc9d78b17361d30b692ba2facf9b4 (patch) | |
tree | 1ba7059e8b1c47eb075acc906f8ef01f9c490ba1 /net/rxrpc/peer_event.c | |
parent | leds: Use vtime aware kcpustat accessor to fetch CPUTIME_SYSTEM (diff) | |
parent | Linux 5.4-rc7 (diff) | |
download | linux-6d5a763c303bc9d78b17361d30b692ba2facf9b4.tar.xz linux-6d5a763c303bc9d78b17361d30b692ba2facf9b4.zip |
Merge tag 'v5.4-rc7' into sched/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'net/rxrpc/peer_event.c')
-rw-r--r-- | net/rxrpc/peer_event.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/net/rxrpc/peer_event.c b/net/rxrpc/peer_event.c index c97ebdc043e4..48f67a9b1037 100644 --- a/net/rxrpc/peer_event.c +++ b/net/rxrpc/peer_event.c @@ -147,10 +147,16 @@ void rxrpc_error_report(struct sock *sk) { struct sock_exterr_skb *serr; struct sockaddr_rxrpc srx; - struct rxrpc_local *local = sk->sk_user_data; + struct rxrpc_local *local; struct rxrpc_peer *peer; struct sk_buff *skb; + rcu_read_lock(); + local = rcu_dereference_sk_user_data(sk); + if (unlikely(!local)) { + rcu_read_unlock(); + return; + } _enter("%p{%d}", sk, local->debug_id); /* Clear the outstanding error value on the socket so that it doesn't @@ -160,6 +166,7 @@ void rxrpc_error_report(struct sock *sk) skb = sock_dequeue_err_skb(sk); if (!skb) { + rcu_read_unlock(); _leave("UDP socket errqueue empty"); return; } @@ -167,11 +174,11 @@ void rxrpc_error_report(struct sock *sk) serr = SKB_EXT_ERR(skb); if (!skb->len && serr->ee.ee_origin == SO_EE_ORIGIN_TIMESTAMPING) { _leave("UDP empty message"); + rcu_read_unlock(); rxrpc_free_skb(skb, rxrpc_skb_freed); return; } - rcu_read_lock(); peer = rxrpc_lookup_peer_icmp_rcu(local, skb, &srx); if (peer && !rxrpc_get_peer_maybe(peer)) peer = NULL; |