Commit 95964c6d authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

net: use proper lockdep annotation in __sk_dst_set()



__sk_dst_set() must be called while we own the socket.

We can get proper lockdep coverage using lockdep_sock_is_held()
and rcu_dereference_protected()

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 337e6392
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -1780,11 +1780,8 @@ __sk_dst_set(struct sock *sk, struct dst_entry *dst)

	sk_tx_queue_clear(sk);
	sk->sk_dst_pending_confirm = 0;
	/*
	 * This can be called while sk is owned by the caller only,
	 * with no state that can be checked in a rcu_dereference_check() cond
	 */
	old_dst = rcu_dereference_raw(sk->sk_dst_cache);
	old_dst = rcu_dereference_protected(sk->sk_dst_cache,
					    lockdep_sock_is_held(sk));
	rcu_assign_pointer(sk->sk_dst_cache, dst);
	dst_release(old_dst);
}