summaryrefslogtreecommitdiffstats
path: root/net/decnet/af_decnet.c
diff options
context:
space:
mode:
authorCong Wang <amwang@redhat.com>2013-01-22 21:09:50 +0000
committerDavid S. Miller <davem@davemloft.net>2013-01-28 00:15:27 -0500
commitcec771d646d6c9a6f123b50e132ab142342dcb97 (patch)
treed0591d47af01fb210a16635ff316e77161c5ec3a /net/decnet/af_decnet.c
parent78fb2de711ec28997bf38bcf3e48e108e907be77 (diff)
downloadlinux-cec771d646d6c9a6f123b50e132ab142342dcb97.tar.bz2
decnet: use correct RCU API to deref sk_dst_cache field
sock->sk_dst_cache is protected by RCU, therefore we should use __sk_dst_get() to deref it once we lock the sock. This fixes several sparse warnings. Cc: linux-decnet-user@lists.sourceforge.net Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet/af_decnet.c')
-rw-r--r--net/decnet/af_decnet.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index 307c322d53bb..64d9843f9e04 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -909,6 +909,7 @@ static int __dn_connect(struct sock *sk, struct sockaddr_dn *addr, int addrlen,
struct dn_scp *scp = DN_SK(sk);
int err = -EISCONN;
struct flowidn fld;
+ struct dst_entry *dst;
if (sock->state == SS_CONNECTED)
goto out;
@@ -955,10 +956,11 @@ static int __dn_connect(struct sock *sk, struct sockaddr_dn *addr, int addrlen,
fld.flowidn_proto = DNPROTO_NSP;
if (dn_route_output_sock(&sk->sk_dst_cache, &fld, sk, flags) < 0)
goto out;
- sk->sk_route_caps = sk->sk_dst_cache->dev->features;
+ dst = __sk_dst_get(sk);
+ sk->sk_route_caps = dst->dev->features;
sock->state = SS_CONNECTING;
scp->state = DN_CI;
- scp->segsize_loc = dst_metric_advmss(sk->sk_dst_cache);
+ scp->segsize_loc = dst_metric_advmss(dst);
dn_nsp_send_conninit(sk, NSP_CI);
err = -EINPROGRESS;