diff --git a/sys/compat/linux/linux.c b/sys/compat/linux/linux.c --- a/sys/compat/linux/linux.c +++ b/sys/compat/linux/linux.c @@ -400,28 +400,20 @@ socklen_t len) { struct l_sockaddr *kosa; - int error, bdom; + int bdom; *lsa = NULL; if (len < 2 || len > UCHAR_MAX) return (EINVAL); + bdom = bsd_to_linux_domain(sa->sa_family); + if (bdom == -1) + return (EAFNOSUPPORT); kosa = malloc(len, M_SONAME, M_WAITOK); bcopy(sa, kosa, len); - - bdom = bsd_to_linux_domain(sa->sa_family); - if (bdom == -1) { - error = EAFNOSUPPORT; - goto out; - } - kosa->sa_family = bdom; *lsa = kosa; return (0); - -out: - free(kosa, M_SONAME); - return (error); } int