diff options
author | Alex Shi <alex.shi@linaro.org> | 2016-04-21 14:08:44 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2016-04-21 14:08:44 +0800 |
commit | bab15641824ad77e5f3af9cc4b84308cba32aa7d (patch) | |
tree | 6a7333fc6f30e08a7142daa5dbc1dd2bf5d08dca /net/socket.c | |
parent | 08562bfcb85748c69e5824fc6d1d77d5725787e4 (diff) | |
parent | 2bf7955152a0544342fcaed28930748cc68392ae (diff) |
Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android
Conflicts:
d_canonical_path in include/linux/dcache.h
Diffstat (limited to 'net/socket.c')
-rw-r--r-- | net/socket.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/net/socket.c b/net/socket.c index d730ef9dfbf0..263b334ec5e4 100644 --- a/net/socket.c +++ b/net/socket.c @@ -2238,31 +2238,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, |