]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - net/unix/af_unix.c
Merge tag 'for-linus-20170825' of git://git.infradead.org/linux-mtd
[mirror_ubuntu-artful-kernel.git] / net / unix / af_unix.c
index 7b52a380d710d238c440293b6d3b8973fc30c90c..be8982b4f8c00be8bb95748c1c33a76e13079dff 100644 (file)
@@ -2304,10 +2304,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;