diff options
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 982b4ecd187b..0fbae85c6d55 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1166,7 +1166,10 @@ static inline int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb) | |||
1166 | 1166 | ||
1167 | static inline int sock_error(struct sock *sk) | 1167 | static inline int sock_error(struct sock *sk) |
1168 | { | 1168 | { |
1169 | int err = xchg(&sk->sk_err, 0); | 1169 | int err; |
1170 | if (likely(!sk->sk_err)) | ||
1171 | return 0; | ||
1172 | err = xchg(&sk->sk_err, 0); | ||
1170 | return -err; | 1173 | return -err; |
1171 | } | 1174 | } |
1172 | 1175 | ||