netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] vsock/virtio: Fix error code in virtio_transport_recv_listen()
@ 2025-12-11  7:45 Dan Carpenter
  2025-12-11  7:50 ` Michael S. Tsirkin
  2025-12-11  8:30 ` Stefano Garzarella
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2025-12-11  7:45 UTC (permalink / raw)
  To: Stefano Garzarella
  Cc: Michael S. Tsirkin, Jason Wang, Xuan Zhuo, Eugenio Pérez,
	Stefan Hajnoczi, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, virtualization, kvm, netdev,
	linux-kernel, kernel-janitors

Return a negative error code if the transport doesn't match.  Don't
return success.

Fixes: c0cfa2d8a788 ("vsock: add multi-transports support")
Cc: stable@vger.kernel.org
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
From static analysis.  Not tested.

 net/vmw_vsock/virtio_transport_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
index dcc8a1d5851e..77fbc6c541bf 100644
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -1550,7 +1550,7 @@ virtio_transport_recv_listen(struct sock *sk, struct sk_buff *skb,
 		release_sock(child);
 		virtio_transport_reset_no_sock(t, skb);
 		sock_put(child);
-		return ret;
+		return ret ?: -EINVAL;
 	}
 
 	if (virtio_transport_space_update(child, skb))
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-12-11  8:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-11  7:45 [PATCH net] vsock/virtio: Fix error code in virtio_transport_recv_listen() Dan Carpenter
2025-12-11  7:50 ` Michael S. Tsirkin
2025-12-11  8:30 ` Stefano Garzarella
2025-12-11  8:38   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).