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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <wangliang74@xxxxxxxxxx>
---
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@xxxxxxxxxx>


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







[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux