summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArseniy Krasnov <avkrasnov@sberdevices.ru>2023-04-03 14:25:12 +0300
committerPaolo Abeni <pabeni@redhat.com>2023-04-04 12:46:24 +0200
commit02ab696febab622c4c837d509f6825884c952c22 (patch)
treee852caac0001f620d5295e6f00537e74ecad5229
parentf59f3006ca7b2fc9bf38fbf44e3dc4b1fbd686c1 (diff)
vsock: return errors other than -ENOMEM to socket
This removes behaviour, where error code returned from any transport was always switched to ENOMEM. This works in the same way as: commit c43170b7e157 ("vsock: return errors other than -ENOMEM to socket"), but for receive calls. Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
-rw-r--r--net/vmw_vsock/af_vsock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 5f2dda35c980..413407bb646c 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -2043,7 +2043,7 @@ static int __vsock_stream_recvmsg(struct sock *sk, struct msghdr *msg,
read = transport->stream_dequeue(vsk, msg, len - copied, flags);
if (read < 0) {
- err = -ENOMEM;
+ err = read;
break;
}
@@ -2094,7 +2094,7 @@ static int __vsock_seqpacket_recvmsg(struct sock *sk, struct msghdr *msg,
msg_len = transport->seqpacket_dequeue(vsk, msg, flags);
if (msg_len < 0) {
- err = -ENOMEM;
+ err = msg_len;
goto out;
}