summaryrefslogtreecommitdiffstats
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-26 06:39:46 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-26 06:39:46 +0900
commit0bbc367e21bfeea33230d893be4fa3a3ff9bcb48 (patch)
tree50fb335648a22ac519eddb772714ba64a3e6a7ec /net/unix/af_unix.c
parentae416ba4e94a30486ba2af0afe052579e7114ab8 (diff)
parent32b88194f71d6ae7768a29f87fbba454728273ee (diff)
downloadblackbird-op-linux-0bbc367e21bfeea33230d893be4fa3a3ff9bcb48.tar.gz
blackbird-op-linux-0bbc367e21bfeea33230d893be4fa3a3ff9bcb48.zip
Merge 4.3-rc7 into usb-next
We want the USB and other fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r--net/unix/af_unix.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index ef31b40ad550..94f658235fb4 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2064,6 +2064,11 @@ static int unix_stream_read_generic(struct unix_stream_read_state *state)
goto out;
}
+ if (flags & MSG_PEEK)
+ skip = sk_peek_offset(sk, flags);
+ else
+ skip = 0;
+
do {
int chunk;
struct sk_buff *skb, *last;
@@ -2112,7 +2117,6 @@ unlock:
break;
}
- skip = sk_peek_offset(sk, flags);
while (skip >= unix_skb_len(skb)) {
skip -= unix_skb_len(skb);
last = skb;
@@ -2179,14 +2183,12 @@ unlock:
if (UNIXCB(skb).fp)
scm.fp = scm_fp_dup(UNIXCB(skb).fp);
- if (skip) {
- sk_peek_offset_fwd(sk, chunk);
- skip -= chunk;
- }
+ sk_peek_offset_fwd(sk, chunk);
if (UNIXCB(skb).fp)
break;
+ skip = 0;
last = skb;
last_len = skb->len;
unix_state_lock(sk);
OpenPOWER on IntegriCloud