mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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: [email protected] Cc: Eric Dumazet <[email protected]> Cc: David S. Miller <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
78fb2de711
commit
cec771d646
4 changed files with 7 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -598,7 +598,7 @@ void dn_nsp_send_disc(struct sock *sk, unsigned char msgflg,
|
|||
if (reason == 0)
|
||||
reason = le16_to_cpu(scp->discdata_out.opt_status);
|
||||
|
||||
dn_nsp_do_disc(sk, msgflg, reason, gfp, sk->sk_dst_cache, ddl,
|
||||
dn_nsp_do_disc(sk, msgflg, reason, gfp, __sk_dst_get(sk), ddl,
|
||||
scp->discdata_out.opt_data, scp->addrrem, scp->addrloc);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1282,7 +1282,7 @@ static int dn_route_output_key(struct dst_entry **pprt, struct flowidn *flp, int
|
|||
return err;
|
||||
}
|
||||
|
||||
int dn_route_output_sock(struct dst_entry **pprt, struct flowidn *fl, struct sock *sk, int flags)
|
||||
int dn_route_output_sock(struct dst_entry __rcu **pprt, struct flowidn *fl, struct sock *sk, int flags)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue