Merge tag 'v3.10.102' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / socket.c
index 354969e1fecd1012b6e60253a664535610af5f79..79f983e68b39c8cf06312ee7a65e65d85dfcbe64 100644 (file)
@@ -2445,27 +2445,26 @@ int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen,
        }
 
        if (err == 0)
-               goto out_put;           
+               goto out_put;
 
        if (datagrams == 0) {
                datagrams = err;
                goto out_put;
        }
 
+       /*
+        * We may return less entries than requested (vlen) if the
+        * sock is non block and there aren't enough datagrams...
+        */
+       if (err != -EAGAIN) {
                /*
-                * We may return less entries than requested (vlen) if the
-                * sock is non block and there aren't enough datagrams...
+                * ... or  if recvmsg returns an error after we
+                * received some datagrams, where we record the
+                * error to return on the next call or if the
+                * app asks about it using getsockopt(SO_ERROR).
                 */
-               if (err != -EAGAIN) {
-                       /*
-                        * ... or  if recvmsg returns an error after we
-                        * received some datagrams, where we record the
-                        * error to return on the next call or if the
-                        * app asks about it using getsockopt(SO_ERROR).
-                        */
-                       sock->sk->sk_err = -err;
-               }
-
+               sock->sk->sk_err = -err;
+       }
 out_put:
        fput_light(sock->file, fput_needed);