Skip to content

Commit 002f79a

Browse files
Wang Liangkuba-moo
authored andcommitted
vsock: remove unnecessary null check in vsock_getname()
The local variable 'vm_addr' is always not NULL, no need to check it. Signed-off-by: Wang Liang <[email protected]> Reviewed-by: Stefano Garzarella <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent d7e0d32 commit 002f79a

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

net/vmw_vsock/af_vsock.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,11 +1028,6 @@ static int vsock_getname(struct socket *sock,
10281028
vm_addr = &vsk->local_addr;
10291029
}
10301030

1031-
if (!vm_addr) {
1032-
err = -EINVAL;
1033-
goto out;
1034-
}
1035-
10361031
/* sys_getsockname() and sys_getpeername() pass us a
10371032
* MAX_SOCK_ADDR-sized buffer and don't set addr_len. Unfortunately
10381033
* that macro is defined in socket.c instead of .h, so we hardcode its

0 commit comments

Comments
 (0)