All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] vsock: remove unnecessary null check in vsock_getname()
@ 2025-07-25  1:38 Wang Liang
  2025-07-25  8:39 ` Stefano Garzarella
  2025-07-26 18:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Wang Liang @ 2025-07-25  1:38 UTC (permalink / raw)
  To: sgarzare, davem, edumazet, kuba, pabeni, horms
  Cc: yuehaibing, zhangchangzhong, wangliang74, virtualization, netdev,
	linux-kernel

The local variable 'vm_addr' is always not NULL, no need to check it.

Signed-off-by: Wang Liang <wangliang74@huawei.com>
---
 net/vmw_vsock/af_vsock.c | 5 -----
 1 file changed, 5 deletions(-)

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


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

end of thread, other threads:[~2025-07-26 18:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-25  1:38 [PATCH net-next] vsock: remove unnecessary null check in vsock_getname() Wang Liang
2025-07-25  8:39 ` Stefano Garzarella
2025-07-26 18:40 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.