Skip to content

Commit fde40bd

Browse files
edumazetgregkh
authored andcommitted
net: fix sparse warning in sk_dst_set()
[ Upstream commit 5925a0555bdaf0b396a84318cbc21ba085f6c0d3 ] sk_dst_cache has __rcu annotation, so we need a cast to avoid following sparse error : include/net/sock.h:1774:19: warning: incorrect type in initializer (different address spaces) include/net/sock.h:1774:19: expected struct dst_entry [noderef] <asn:4>*__ret include/net/sock.h:1774:19: got struct dst_entry *dst Signed-off-by: Eric Dumazet <edumazet@google.com> Reported-by: kbuild test robot <fengguang.wu@intel.com> Fixes: 7f502361531e ("ipv4: irq safe sk_dst_[re]set() and ipv4_sk_update_pmtu() fix") Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent cd6893f commit fde40bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/net/sock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1796,7 +1796,7 @@ sk_dst_set(struct sock *sk, struct dst_entry *dst)
17961796
struct dst_entry *old_dst;
17971797

17981798
sk_tx_queue_clear(sk);
1799-
old_dst = xchg(&sk->sk_dst_cache, dst);
1799+
old_dst = xchg((__force struct dst_entry **)&sk->sk_dst_cache, dst);
18001800
dst_release(old_dst);
18011801
}
18021802

0 commit comments

Comments
 (0)