From da90486716abfdd548601f005a1d36a0f0fbf77a Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 2 Oct 2016 19:26:46 +0000 Subject: [PATCH] more MFREE -> m_free --- sys/kern/uipc_socket.c | 13 +++++-------- sys/kern/uipc_socket2.c | 16 +++++++--------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 1c0228d621e1..577b4d2c8cc8 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket.c,v 1.248 2016/06/10 13:27:15 ozaki-r Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.249 2016/10/02 19:26:46 christos Exp $ */ /*- * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.248 2016/06/10 13:27:15 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.249 2016/10/02 19:26:46 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -1324,8 +1324,7 @@ soreceive(struct socket *so, struct mbuf **paddr, struct uio *uio, m->m_next = NULL; m = so->so_rcv.sb_mb; } else { - MFREE(m, so->so_rcv.sb_mb); - m = so->so_rcv.sb_mb; + m = so->so_rcv.sb_mb = m_free(m); } sbsync(&so->so_rcv, nextrecord); } @@ -1349,8 +1348,7 @@ soreceive(struct socket *so, struct mbuf **paddr, struct uio *uio, m->m_next = 0; m = so->so_rcv.sb_mb; } else { - MFREE(m, so->so_rcv.sb_mb); - m = so->so_rcv.sb_mb; + m = so->so_rcv.sb_mb = m_free(m); } } } @@ -1505,8 +1503,7 @@ soreceive(struct socket *so, struct mbuf **paddr, struct uio *uio, so->so_rcv.sb_mb = m = m->m_next; *mp = NULL; } else { - MFREE(m, so->so_rcv.sb_mb); - m = so->so_rcv.sb_mb; + m = so->so_rcv.sb_mb = m_free(m); } /* * If m != NULL, we also know that diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index 3e507c2fa6c3..ed07e88271cc 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket2.c,v 1.123 2016/05/23 13:54:34 tls Exp $ */ +/* $NetBSD: uipc_socket2.c,v 1.124 2016/10/02 19:26:46 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.123 2016/05/23 13:54:34 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.124 2016/10/02 19:26:46 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_mbuftrace.h" @@ -1167,7 +1167,7 @@ bad: sbfree(sb, np); n0 = n->m_nextpkt; /* iterate at next prepended address */ - MFREE(n, np); /* free prepended address (not data) */ + np = m_free(n); /* free prepended address (not data) */ } return error; } @@ -1297,7 +1297,7 @@ sbflush(struct sockbuf *sb) void sbdrop(struct sockbuf *sb, int len) { - struct mbuf *m, *mn, *next; + struct mbuf *m, *next; KASSERT(solocked(sb->sb_so)); @@ -1319,13 +1319,11 @@ sbdrop(struct sockbuf *sb, int len) } len -= m->m_len; sbfree(sb, m); - MFREE(m, mn); - m = mn; + m = m_free(m); } while (m && m->m_len == 0) { sbfree(sb, m); - MFREE(m, mn); - m = mn; + m = m_free(m); } if (m) { sb->sb_mb = m; @@ -1361,7 +1359,7 @@ sbdroprecord(struct sockbuf *sb) sb->sb_mb = m->m_nextpkt; do { sbfree(sb, m); - MFREE(m, mn); + mn = m_free(m); } while ((m = mn) != NULL); } SB_EMPTY_FIXUP(sb);