X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=include%2Fnet%2Fsock.h;h=a7273b28918846233d93665f0fcd4b0a18b90d23;hb=272ac32f566e3f925b20c231a2b30f6893aa258a;hp=f7ad1a7705e915b3829efb8951c50d5e194d75f9;hpb=602ae008ab14165aa263103c38c54d2f89a85ead;p=linux-2.6-microblaze.git diff --git a/include/net/sock.h b/include/net/sock.h index f7ad1a7705e9..a7273b289188 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -2823,18 +2823,18 @@ static inline int sk_get_wmem0(const struct sock *sk, const struct proto *proto) { /* Does this proto have per netns sysctl_wmem ? */ if (proto->sysctl_wmem_offset) - return *(int *)((void *)sock_net(sk) + proto->sysctl_wmem_offset); + return READ_ONCE(*(int *)((void *)sock_net(sk) + proto->sysctl_wmem_offset)); - return *proto->sysctl_wmem; + return READ_ONCE(*proto->sysctl_wmem); } static inline int sk_get_rmem0(const struct sock *sk, const struct proto *proto) { /* Does this proto have per netns sysctl_rmem ? */ if (proto->sysctl_rmem_offset) - return *(int *)((void *)sock_net(sk) + proto->sysctl_rmem_offset); + return READ_ONCE(*(int *)((void *)sock_net(sk) + proto->sysctl_rmem_offset)); - return *proto->sysctl_rmem; + return READ_ONCE(*proto->sysctl_rmem); } /* Default TCP Small queue budget is ~1 ms of data (1sec >> 10)