summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-11-28 13:55:44 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-11-28 13:55:44 +0000
commitea85232c8fc29eb2dbfb70ff2cb4b00fc25270b8 (patch)
tree86050bcc59b4db4c3099e518d58ac2de865f457c /sys
parentff20ee7fc65d42f43c5b410ac6c3b23a8f269acc (diff)
Remove NULL checks before m_free{m,}().
ok reyk@, rzalamena@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_syscalls.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 5dc464e863c..09d345491d7 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_syscalls.c,v 1.140 2016/11/21 09:09:06 mpi Exp $ */
+/* $OpenBSD: uipc_syscalls.c,v 1.141 2016/11/28 13:55:43 mpi Exp $ */
/* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */
/*
@@ -721,8 +721,7 @@ sendit(struct proc *p, int s, struct msghdr *mp, int flags, register_t *retsize)
#endif
bad:
FRELE(fp, p);
- if (to)
- m_freem(to);
+ m_freem(to);
return (error);
}
@@ -930,10 +929,8 @@ recvit(struct proc *p, int s, struct msghdr *mp, caddr_t namelenp,
}
out:
FRELE(fp, p);
- if (from)
- m_freem(from);
- if (control)
- m_freem(control);
+ m_freem(from);
+ m_freem(control);
return (error);
}
@@ -1001,8 +998,7 @@ sys_setsockopt(struct proc *p, void *v, register_t *retval)
error = sosetopt(fp->f_data, SCARG(uap, level), SCARG(uap, name), m);
m = NULL;
bad:
- if (m)
- m_freem(m);
+ m_freem(m);
FRELE(fp, p);
return (error);
}
@@ -1046,8 +1042,7 @@ sys_getsockopt(struct proc *p, void *v, register_t *retval)
}
out:
FRELE(fp, p);
- if (m != NULL)
- (void)m_free(m);
+ m_free(m);
return (error);
}