|
@@ -1064,7 +1064,11 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
|
|
|
break;
|
|
|
}
|
|
|
used = recv_actor(desc, skb, offset, len);
|
|
|
- if (used <= len) {
|
|
|
+ if (used < 0) {
|
|
|
+ if (!copied)
|
|
|
+ copied = used;
|
|
|
+ break;
|
|
|
+ } else if (used <= len) {
|
|
|
seq += used;
|
|
|
copied += used;
|
|
|
offset += used;
|
|
@@ -1086,7 +1090,7 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
|
|
|
tcp_rcv_space_adjust(sk);
|
|
|
|
|
|
/* Clean up data we have read: This will do ACK frames. */
|
|
|
- if (copied)
|
|
|
+ if (copied > 0)
|
|
|
tcp_cleanup_rbuf(sk, copied);
|
|
|
return copied;
|
|
|
}
|