diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-08 20:02:31 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-08 20:02:31 -0800 |
commit | dde86f41f4cb13015288abcff4706993c007f65d (patch) | |
tree | 2e981cfa9eca8bddd5dcef63957f677ad2f7b15b /net/ipv4/udp.c | |
parent | 3b2c67de4650a725654cf9bf36e0025ca10442cd (diff) | |
parent | 802eee95bde72fd0cd0f3a5b2098375a487d1eda (diff) |
Merge v3.13-rc6 into char-misc-next
We want these fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r-- | net/ipv4/udp.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 62c19fdd102..f140048334c 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1600,20 +1600,15 @@ static void flush_stack(struct sock **stack, unsigned int count, } /* For TCP sockets, sk_rx_dst is protected by socket lock - * For UDP, we use sk_dst_lock to guard against concurrent changes. + * For UDP, we use xchg() to guard against concurrent changes. */ static void udp_sk_rx_dst_set(struct sock *sk, struct dst_entry *dst) { struct dst_entry *old; - spin_lock(&sk->sk_dst_lock); - old = sk->sk_rx_dst; - if (likely(old != dst)) { - dst_hold(dst); - sk->sk_rx_dst = dst; - dst_release(old); - } - spin_unlock(&sk->sk_dst_lock); + dst_hold(dst); + old = xchg(&sk->sk_rx_dst, dst); + dst_release(old); } /* |