Thread (3 messages) 3 messages, 3 authors, 2025-07-26

Re: [PATCH net-next] vsock: remove unnecessary null check in vsock_getname()

From: Stefano Garzarella <sgarzare@redhat.com>
Date: 2025-07-25 08:39:36
Also in: lkml, virtualization

On Fri, Jul 25, 2025 at 09:38:08AM +0800, Wang Liang wrote:
The local variable 'vm_addr' is always not NULL, no need to check it.

Signed-off-by: Wang Liang <redacted>
---
net/vmw_vsock/af_vsock.c | 5 -----
1 file changed, 5 deletions(-)
Thanks for the cleanup! We've had it since the beginning, maybe some 
changes were made during initial development...

LGTM!

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
quoted hunk ↗ jump to hunk
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 1053662725f8..fae512594849 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -1028,11 +1028,6 @@ static int vsock_getname(struct socket *sock,
		vm_addr = &vsk->local_addr;
	}

-	if (!vm_addr) {
-		err = -EINVAL;
-		goto out;
-	}
-
	/* sys_getsockname() and sys_getpeername() pass us a
	 * MAX_SOCK_ADDR-sized buffer and don't set addr_len.  Unfortunately
	 * that macro is defined in socket.c instead of .h, so we hardcode its
-- 
2.34.1
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help