From: Michal Luczaj <mhal@rbox.co>
To: "Stefan Hajnoczi" <stefanha@redhat.com>,
"Stefano Garzarella" <sgarzare@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Jason Wang" <jasowangio@gmail.com>,
"Eugenio Pérez" <eperezma@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Simon Horman" <horms@kernel.org>
Cc: kvm@vger.kernel.org, virtualization@lists.linux.dev,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Michal Luczaj <mhal@rbox.co>
Subject: [PATCH net v3 2/8] vsock: simplify error check condition
Date: Tue, 22 Sep 2026 15:14:56 +0200 [thread overview]
Message-ID: <20260922-vsock-connect-reset-closing-v3-2-78907b8200d4@rbox.co> (raw)
In-Reply-To: <20260922-vsock-connect-reset-closing-v3-0-78907b8200d4@rbox.co>
On success, vsock_assign_transport() ensures transport != NULL.
Drop the redundant check.
Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
net/vmw_vsock/af_vsock.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 9b71479a2b29..5c8e7e7d35b4 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -1757,8 +1757,7 @@ static int vsock_connect(struct socket *sock, struct sockaddr_unsized *addr,
/* The hypervisor and well-known contexts do not have socket
* endpoints.
*/
- if (!transport ||
- !transport->stream_allow(vsk, remote_addr->svm_cid,
+ if (!transport->stream_allow(vsk, remote_addr->svm_cid,
remote_addr->svm_port)) {
err = -ENETUNREACH;
goto out;
--
2.55.0
next prev parent reply other threads:[~2026-09-22 13:15 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 13:14 [PATCH net v3 0/8] vsock: fix connect() races Michal Luczaj
2026-09-22 13:14 ` [PATCH net v3 1/8] vhost/vsock: Fix socket state constant Michal Luczaj
2026-09-22 13:14 ` Michal Luczaj [this message]
2026-09-28 10:12 ` [PATCH net v3 2/8] vsock: simplify error check condition Luigi Leonardi
2026-09-22 13:14 ` [PATCH net v3 3/8] vsock: do not preserve transport assignment Michal Luczaj
2026-09-24 13:15 ` netdev-bot+sashiko
2026-09-24 21:27 ` Michal Luczaj
2026-09-22 13:14 ` [PATCH net v3 4/8] vsock: drop the re-assignment logic Michal Luczaj
2026-09-24 13:15 ` netdev-bot+sashiko
2026-09-24 21:27 ` Michal Luczaj
2026-09-22 13:14 ` [PATCH net v3 5/8] vsock: treat TCP_CLOSING as once-established Michal Luczaj
2026-09-24 13:15 ` netdev-bot+sashiko
2026-09-24 21:27 ` Michal Luczaj
2026-09-22 13:15 ` [PATCH net v3 6/8] vsock: handle socket bricking due to transport event Michal Luczaj
2026-09-24 13:15 ` netdev-bot+sashiko
2026-09-24 21:28 ` Michal Luczaj
2026-09-22 13:15 ` [PATCH net v3 7/8] vsock: handle listen() racing connect() Michal Luczaj
2026-09-24 13:15 ` netdev-bot+sashiko
2026-09-24 21:28 ` Michal Luczaj
2026-09-22 13:15 ` [PATCH net v3 8/8] vsock: enforce no-transport invariant for TCP_LISTEN sockets Michal Luczaj
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260922-vsock-connect-reset-closing-v3-2-78907b8200d4@rbox.co \
--to=mhal@rbox.co \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eperezma@redhat.com \
--cc=horms@kernel.org \
--cc=jasowangio@gmail.com \
--cc=kuba@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sgarzare@redhat.com \
--cc=stefanha@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox