git: 6016aedba1e3 - main - uipc_syscalls: removed unnecessary check in accept1() function
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 12 Jun 2023 14:49:40 UTC
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6016aedba1e3701c7c12459effe55e84d7a18b1e commit 6016aedba1e3701c7c12459effe55e84d7a18b1e Author: Dmitriy Alexandrov <d06alexandrov@users.noreply.github.com> AuthorDate: 2023-06-12 14:44:08 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2023-06-12 14:49:13 +0000 uipc_syscalls: removed unnecessary check in accept1() function Signed-off-by: Dmitriy Alexandrov <d06alexandrov@gmail.com> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/773 --- sys/kern/uipc_syscalls.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 496e93d76bb0..0d3581eacca9 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -298,15 +298,13 @@ accept1(struct thread *td, int s, struct sockaddr *uname, socklen_t *anamelen, if (error != 0) return (error); - if (error == 0 && uname != NULL) { #ifdef COMPAT_OLDSOCK - if (SV_PROC_FLAG(td->td_proc, SV_AOUT) && - (flags & ACCEPT4_COMPAT) != 0) - ((struct osockaddr *)name)->sa_family = - name->sa_family; + if (SV_PROC_FLAG(td->td_proc, SV_AOUT) && + (flags & ACCEPT4_COMPAT) != 0) + ((struct osockaddr *)name)->sa_family = + name->sa_family; #endif - error = copyout(name, uname, namelen); - } + error = copyout(name, uname, namelen); if (error == 0) error = copyout(&namelen, anamelen, sizeof(namelen));