diff options
author | David S. Miller <davem@davemloft.net> | 2017-08-22 02:06:42 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-22 02:06:42 +0200 |
commit | e2a7c34fb2856fd5306e307e170e3dde358d0dce (patch) | |
tree | afeb300b04186b1a1f649b2cd8a401a75878297c /net/unix | |
parent | net: sched: Add the invalid handle check in qdisc_class_find (diff) | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc (diff) | |
download | linux-e2a7c34fb2856fd5306e307e170e3dde358d0dce.tar.xz linux-e2a7c34fb2856fd5306e307e170e3dde358d0dce.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/unix')
-rw-r--r-- | net/unix/af_unix.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 5c53f22d62e8..7f46bab4ce5c 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -2283,10 +2283,7 @@ static int unix_stream_read_generic(struct unix_stream_read_state *state, */ mutex_lock(&u->iolock); - if (flags & MSG_PEEK) - skip = sk_peek_offset(sk, flags); - else - skip = 0; + skip = max(sk_peek_offset(sk, flags), 0); do { int chunk; |