diff options
author | Peter Valchev <pvalchev@cvs.openbsd.org> | 2002-08-23 01:13:10 +0000 |
---|---|---|
committer | Peter Valchev <pvalchev@cvs.openbsd.org> | 2002-08-23 01:13:10 +0000 |
commit | aa5287bbf32c33d0ba2329ad1e640e84326707c3 (patch) | |
tree | 8eec06d0c4a0c8a487c3409473ad18c6cb8295dc /sys/compat | |
parent | 7b3f8875a9bad5d14096d23a856098592ed51505 (diff) |
FREF/FRELE cleanup/simplification, no functional changes; ok art
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/sunos/sunos_misc.c | 13 | ||||
-rw-r--r-- | sys/compat/ultrix/ultrix_misc.c | 13 |
2 files changed, 12 insertions, 14 deletions
diff --git a/sys/compat/sunos/sunos_misc.c b/sys/compat/sunos/sunos_misc.c index a0cf2d5b6d6..330f38a1a18 100644 --- a/sys/compat/sunos/sunos_misc.c +++ b/sys/compat/sunos/sunos_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sunos_misc.c,v 1.38 2002/07/25 22:18:27 nordin Exp $ */ +/* $OpenBSD: sunos_misc.c,v 1.39 2002/08/23 01:13:09 pvalchev Exp $ */ /* $NetBSD: sunos_misc.c,v 1.65 1996/04/22 01:44:31 christos Exp $ */ /* @@ -537,8 +537,7 @@ sunos_sys_setsockopt(p, v, retval) m->m_len = sizeof(struct linger); error = (sosetopt((struct socket *)fp->f_data, SCARG(uap, level), SO_LINGER, m)); - FRELE(fp); - return (error); + goto bad; } if (SCARG(uap, level) == IPPROTO_IP) { #define SUNOS_IP_MULTICAST_IF 2 @@ -560,22 +559,22 @@ sunos_sys_setsockopt(p, v, retval) } } if (SCARG(uap, valsize) > MLEN) { - FRELE(fp); - return (EINVAL); + error = EINVAL; + goto bad; } if (SCARG(uap, val)) { m = m_get(M_WAIT, MT_SOOPTS); error = copyin(SCARG(uap, val), mtod(m, caddr_t), (u_int)SCARG(uap, valsize)); if (error) { - FRELE(fp); (void) m_free(m); - return (error); + goto bad; } m->m_len = SCARG(uap, valsize); } error = (sosetopt((struct socket *)fp->f_data, SCARG(uap, level), SCARG(uap, name), m)); +bad: FRELE(fp); return (error); } diff --git a/sys/compat/ultrix/ultrix_misc.c b/sys/compat/ultrix/ultrix_misc.c index 3dd59b3e51e..2f86fdb9241 100644 --- a/sys/compat/ultrix/ultrix_misc.c +++ b/sys/compat/ultrix/ultrix_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ultrix_misc.c,v 1.26 2002/03/14 20:31:31 mickey Exp $ */ +/* $OpenBSD: ultrix_misc.c,v 1.27 2002/08/23 01:13:09 pvalchev Exp $ */ /* $NetBSD: ultrix_misc.c,v 1.23 1996/04/07 17:23:04 jonathan Exp $ */ /* @@ -361,25 +361,24 @@ ultrix_sys_setsockopt(p, v, retval) m->m_len = sizeof(struct linger); error = (sosetopt((struct socket *)fp->f_data, SCARG(uap, level), SO_LINGER, m)); - FRELE(fp); - return (error); + goto bad; } if (SCARG(uap, valsize) > MLEN) { - FRELE(fp); - return (EINVAL); + error = EINVAL; + goto bad; } if (SCARG(uap, val)) { m = m_get(M_WAIT, MT_SOOPTS); if ((error = copyin(SCARG(uap, val), mtod(m, caddr_t), (u_int)SCARG(uap, valsize))) != 0) { - FRELE(fp); (void) m_free(m); - return (error); + goto bad; } m->m_len = SCARG(uap, valsize); } error = (sosetopt((struct socket *)fp->f_data, SCARG(uap, level), SCARG(uap, name), m)); +bad: FRELE(fp); return (error); } |