aboutsummaryrefslogtreecommitdiff
path: root/net/socket.c
diff options
context:
space:
mode:
authordroidfivex <droidfivex@gmail.com>2016-11-18 01:05:47 +0900
committerdroidfivex <droidfivex@gmail.com>2016-11-18 01:05:47 +0900
commit1e8e1576c95730e425f472a569bb15325329a99e (patch)
tree66b14ebbc47c0bc6023aa57b91b1ab5a9ee6c8e6 /net/socket.c
parent8b77716a2a034c7658ea6569ddaa814c312dd94f (diff)
parent30bdd78c2f639b28acc02a4133479311e01b18ce (diff)
Merge branch 'cm-13.0' into cm-14.1HEADq10.0o8.0n7.1n7.0
Diffstat (limited to 'net/socket.c')
-rw-r--r--net/socket.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/net/socket.c b/net/socket.c
index 9d4b212ae2d..b3e305287bf 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -2290,31 +2290,31 @@ int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen,
break;
}
-out_put:
- fput_light(sock->file, fput_needed);
-
if (err == 0)
- return datagrams;
+ goto out_put;
- if (datagrams != 0) {
+ 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;
- }
-
- return datagrams;
+ sock->sk->sk_err = -err;
}
+out_put:
+ fput_light(sock->file, fput_needed);
- return err;
+ return datagrams;
}
SYSCALL_DEFINE5(recvmmsg, int, fd, struct mmsghdr __user *, mmsg,