Message ID | 2cfe98c9-0b47-d50a-0570-70e6d4af281e@sberdevices.ru (mailing list archive) |
---|---|
State | Accepted |
Commit | f59f3006ca7b2fc9bf38fbf44e3dc4b1fbd686c1 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | vsock: return errors other than -ENOMEM to socket | expand |
diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c index 36eb16a40745..a5375c97f5b0 100644 --- a/net/vmw_vsock/vmci_transport.c +++ b/net/vmw_vsock/vmci_transport.c @@ -1831,10 +1831,17 @@ static ssize_t vmci_transport_stream_dequeue( size_t len, int flags) { + ssize_t err; + if (flags & MSG_PEEK) - return vmci_qpair_peekv(vmci_trans(vsk)->qpair, msg, len, 0); + err = vmci_qpair_peekv(vmci_trans(vsk)->qpair, msg, len, 0); else - return vmci_qpair_dequev(vmci_trans(vsk)->qpair, msg, len, 0); + err = vmci_qpair_dequev(vmci_trans(vsk)->qpair, msg, len, 0); + + if (err < 0) + err = -ENOMEM; + + return err; } static ssize_t vmci_transport_stream_enqueue(