diff options
author | Bobby Eshleman <bobby.eshleman@bytedance.com> | 2023-01-10 13:13:23 +0300 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2023-01-12 14:53:54 +0300 |
commit | c43170b7e1571efc11c443fb8889842073b77fe5 (patch) | |
tree | f491a82760d6e427b058de6170529fd77de6b5b5 /net/vmw_vsock/af_vsock.c | |
parent | d4f12a8271fb724b68af6fe8ef54f0f2e63da74d (diff) | |
download | linux-c43170b7e1571efc11c443fb8889842073b77fe5.tar.xz |
vsock: return errors other than -ENOMEM to socket
This removes behaviour, where error code returned from any transport
was always switched to ENOMEM. For example when user tries to send too
big message via SEQPACKET socket, transport layers return EMSGSIZE, but
this error code was always replaced with ENOMEM and returned to user.
Signed-off-by: Bobby Eshleman <bobby.eshleman@bytedance.com>
Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/vmw_vsock/af_vsock.c')
-rw-r--r-- | net/vmw_vsock/af_vsock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index d593d5b6d4b1..19aea7cba26e 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -1861,8 +1861,9 @@ static int vsock_connectible_sendmsg(struct socket *sock, struct msghdr *msg, written = transport->stream_enqueue(vsk, msg, len - total_written); } + if (written < 0) { - err = -ENOMEM; + err = written; goto out_err; } |