summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2008-10-23 15:53:51 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2008-10-23 15:53:51 +0000
commit1ede983cc905643549d8cae56a9d0e28fc68375f (patch)
tree21e792ce590e1bcf9b343890605a1b4c6a9016b3
parent994f9863852fe65833509090659d9f5aef7194d3 (diff)
downloadsrc-test2-1ede983cc905643549d8cae56a9d0e28fc68375f.tar.gz
src-test2-1ede983cc905643549d8cae56a9d0e28fc68375f.zip
Notes
-rw-r--r--Makefile.inc14
-rw-r--r--share/man/man9/Makefile4
-rw-r--r--share/man/man9/malloc.922
-rw-r--r--sys/arm/arm/undefined.c4
-rw-r--r--sys/cam/scsi/scsi_target.c18
-rw-r--r--sys/compat/linux/linux_ioctl.c4
-rw-r--r--sys/compat/linux/linux_socket.c6
-rw-r--r--sys/compat/linux/linux_util.c12
-rw-r--r--sys/contrib/altq/altq/altq_cbq.c10
-rw-r--r--sys/contrib/altq/altq/altq_cdnr.c4
-rw-r--r--sys/contrib/altq/altq/altq_hfsc.c68
-rw-r--r--sys/contrib/altq/altq/altq_priq.c20
-rw-r--r--sys/contrib/altq/altq/altq_red.c44
-rw-r--r--sys/contrib/altq/altq/altq_rio.c22
-rw-r--r--sys/contrib/altq/altq/altq_rmclass.c10
-rw-r--r--sys/contrib/altq/altq/altq_subr.c14
-rw-r--r--sys/contrib/ipfilter/netinet/ip_compat.h21
-rw-r--r--sys/dev/ar/if_ar.c4
-rw-r--r--sys/dev/ce/if_ce.c5
-rw-r--r--sys/dev/hwpmc/hwpmc_amd.c6
-rw-r--r--sys/dev/hwpmc/hwpmc_logging.c4
-rw-r--r--sys/dev/hwpmc/hwpmc_mod.c78
-rw-r--r--sys/dev/hwpmc/hwpmc_piv.c9
-rw-r--r--sys/dev/hwpmc/hwpmc_ppro.c4
-rw-r--r--sys/dev/hwpmc/hwpmc_x86.c4
-rw-r--r--sys/dev/lmc/if_lmc.c4
-rw-r--r--sys/dev/ray/if_ray.c3
-rw-r--r--sys/dev/ray/if_rayvar.h2
-rw-r--r--sys/dev/sr/if_sr.c5
-rw-r--r--sys/dev/usb/udbp.c4
-rw-r--r--sys/fs/cd9660/cd9660_node.c2
-rw-r--r--sys/fs/cd9660/cd9660_vfsops.c2
-rw-r--r--sys/fs/cd9660/cd9660_vnops.c12
-rw-r--r--sys/fs/fdescfs/fdesc_vfsops.c2
-rw-r--r--sys/fs/fdescfs/fdesc_vnops.c6
-rw-r--r--sys/fs/fifofs/fifo_vnops.c4
-rw-r--r--sys/fs/hpfs/hpfs_subr.c21
-rw-r--r--sys/fs/hpfs/hpfs_vfsops.c6
-rw-r--r--sys/fs/hpfs/hpfs_vnops.c4
-rw-r--r--sys/fs/msdosfs/msdosfs_denode.c8
-rw-r--r--sys/fs/msdosfs/msdosfs_vnops.c2
-rw-r--r--sys/fs/ntfs/ntfs_subr.c81
-rw-r--r--sys/fs/ntfs/ntfs_vfsops.c11
-rw-r--r--sys/fs/ntfs/ntfs_vnops.c2
-rw-r--r--sys/fs/nullfs/null_subr.c6
-rw-r--r--sys/fs/nullfs/null_vnops.c2
-rw-r--r--sys/fs/nwfs/nwfs_node.c10
-rw-r--r--sys/fs/nwfs/nwfs_vfsops.c4
-rw-r--r--sys/fs/portalfs/portal_vfsops.c12
-rw-r--r--sys/fs/portalfs/portal_vnops.c6
-rw-r--r--sys/fs/pseudofs/pseudofs.c4
-rw-r--r--sys/fs/pseudofs/pseudofs_vncache.c8
-rw-r--r--sys/fs/smbfs/smbfs_node.c10
-rw-r--r--sys/fs/smbfs/smbfs_vfsops.c2
-rw-r--r--sys/fs/udf/udf_vfsops.c17
-rw-r--r--sys/fs/udf/udf_vnops.c12
-rw-r--r--sys/fs/unionfs/union_subr.c11
-rw-r--r--sys/gnu/fs/ext2fs/ext2_inode.c6
-rw-r--r--sys/gnu/fs/ext2fs/ext2_lookup.c6
-rw-r--r--sys/gnu/fs/ext2fs/ext2_vfsops.c2
-rw-r--r--sys/gnu/fs/reiserfs/reiserfs_inode.c4
-rw-r--r--sys/gnu/fs/reiserfs/reiserfs_vfsops.c2
-rw-r--r--sys/i386/i386/sys_machdep.c14
-rw-r--r--sys/ia64/ia64/sscdisk.c2
-rw-r--r--sys/kern/kern_descrip.c23
-rw-r--r--sys/kern/kern_event.c11
-rw-r--r--sys/kern/kern_jail.c12
-rw-r--r--sys/kern/kern_linker.c5
-rw-r--r--sys/kern/kern_mtxpool.c7
-rw-r--r--sys/kern/kern_proc.c8
-rw-r--r--sys/kern/kern_prot.c16
-rw-r--r--sys/kern/kern_resource.c2
-rw-r--r--sys/kern/subr_blist.c2
-rw-r--r--sys/kern/subr_witness.c3
-rw-r--r--sys/kern/uipc_accf.c28
-rw-r--r--sys/kern/uipc_mqueue.c8
-rw-r--r--sys/kern/uipc_syscalls.c10
-rw-r--r--sys/kern/uipc_usrreq.c2
-rw-r--r--sys/kern/vfs_export.c6
-rw-r--r--sys/kern/vfs_syscalls.c4
-rw-r--r--sys/net/bpf.c2
-rw-r--r--sys/net/bsd_comp.c4
-rw-r--r--sys/net/if.c22
-rw-r--r--sys/net/if_arcsubr.c4
-rw-r--r--sys/net/if_ethersubr.c4
-rw-r--r--sys/net/if_fddisubr.c4
-rw-r--r--sys/net/if_iso88025subr.c4
-rw-r--r--sys/net/if_ppp.c4
-rw-r--r--sys/net/if_sl.c7
-rw-r--r--sys/net/if_tap.c2
-rw-r--r--sys/net/if_tun.c2
-rw-r--r--sys/net/ppp_deflate.c6
-rw-r--r--sys/net/rtsock.c2
-rw-r--r--sys/net80211/ieee80211_acl.c14
-rw-r--r--sys/net80211/ieee80211_crypto_ccmp.c4
-rw-r--r--sys/net80211/ieee80211_crypto_tkip.c4
-rw-r--r--sys/net80211/ieee80211_crypto_wep.c4
-rw-r--r--sys/net80211/ieee80211_freebsd.c4
-rw-r--r--sys/net80211/ieee80211_hostap.c4
-rw-r--r--sys/net80211/ieee80211_input.c2
-rw-r--r--sys/net80211/ieee80211_ioctl.c27
-rw-r--r--sys/net80211/ieee80211_node.c22
-rw-r--r--sys/net80211/ieee80211_power.c4
-rw-r--r--sys/net80211/ieee80211_proto.c2
-rw-r--r--sys/net80211/ieee80211_scan.c4
-rw-r--r--sys/net80211/ieee80211_scan_sta.c10
-rw-r--r--sys/net80211/ieee80211_sta.c2
-rw-r--r--sys/netatalk/ddp_pcb.c4
-rw-r--r--sys/netgraph/atm/sscfu/ng_sscfu_cust.h4
-rw-r--r--sys/netgraph/bluetooth/drivers/h4/ng_h4.c8
-rw-r--r--sys/netgraph/bluetooth/hci/ng_hci_main.c4
-rw-r--r--sys/netgraph/bluetooth/hci/ng_hci_misc.c8
-rw-r--r--sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c4
-rw-r--r--sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c12
-rw-r--r--sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.h2
-rw-r--r--sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c14
-rw-r--r--sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c8
-rw-r--r--sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c9
-rw-r--r--sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c10
-rw-r--r--sys/netgraph/bluetooth/socket/ng_btsocket_sco.c8
-rw-r--r--sys/netgraph/netflow/netflow.c5
-rw-r--r--sys/netgraph/netflow/ng_netflow.c4
-rw-r--r--sys/netgraph/netgraph.h2
-rw-r--r--sys/netgraph/ng_UI.c4
-rw-r--r--sys/netgraph/ng_async.c26
-rw-r--r--sys/netgraph/ng_atmllc.c4
-rw-r--r--sys/netgraph/ng_base.c8
-rw-r--r--sys/netgraph/ng_bpf.c16
-rw-r--r--sys/netgraph/ng_bridge.c28
-rw-r--r--sys/netgraph/ng_cisco.c4
-rw-r--r--sys/netgraph/ng_device.c6
-rw-r--r--sys/netgraph/ng_eiface.c4
-rw-r--r--sys/netgraph/ng_etf.c12
-rw-r--r--sys/netgraph/ng_ether.c4
-rw-r--r--sys/netgraph/ng_fec.c19
-rw-r--r--sys/netgraph/ng_frame_relay.c4
-rw-r--r--sys/netgraph/ng_gif.c4
-rw-r--r--sys/netgraph/ng_gif_demux.c4
-rw-r--r--sys/netgraph/ng_hole.c4
-rw-r--r--sys/netgraph/ng_iface.c6
-rw-r--r--sys/netgraph/ng_ipfw.c4
-rw-r--r--sys/netgraph/ng_ksocket.c26
-rw-r--r--sys/netgraph/ng_l2tp.c9
-rw-r--r--sys/netgraph/ng_lmi.c4
-rw-r--r--sys/netgraph/ng_message.h8
-rw-r--r--sys/netgraph/ng_mppc.c13
-rw-r--r--sys/netgraph/ng_nat.c16
-rw-r--r--sys/netgraph/ng_one2many.c4
-rw-r--r--sys/netgraph/ng_parse.c42
-rw-r--r--sys/netgraph/ng_pipe.c10
-rw-r--r--sys/netgraph/ng_ppp.c4
-rw-r--r--sys/netgraph/ng_pptpgre.c4
-rw-r--r--sys/netgraph/ng_rfc1490.c4
-rw-r--r--sys/netgraph/ng_sample.c6
-rw-r--r--sys/netgraph/ng_split.c4
-rw-r--r--sys/netgraph/ng_sppp.c18
-rw-r--r--sys/netgraph/ng_tag.c20
-rw-r--r--sys/netgraph/ng_tcpmss.c4
-rw-r--r--sys/netgraph/ng_tee.c4
-rw-r--r--sys/netgraph/ng_tty.c4
-rw-r--r--sys/netgraph/ng_vjc.c4
-rw-r--r--sys/netgraph/ng_vlan.c10
-rw-r--r--sys/netinet/igmp.c2
-rw-r--r--sys/netinet/in_mcast.c38
-rw-r--r--sys/netinet/in_pcb.c4
-rw-r--r--sys/netinet/ip_carp.c18
-rw-r--r--sys/netinet/sctp_os_bsd.h8
-rw-r--r--sys/netinet/tcp_syncache.c3
-rw-r--r--sys/netinet6/in6.c4
-rw-r--r--sys/netinet6/in6_pcb.c4
-rw-r--r--sys/netinet6/in6_src.c4
-rw-r--r--sys/netinet6/raw_ip6.c7
-rw-r--r--sys/netipsec/keysock.c2
-rw-r--r--sys/netipsec/xform_ah.c6
-rw-r--r--sys/netipx/ipx_pcb.c4
-rw-r--r--sys/netipx/spx_usrreq.c8
-rw-r--r--sys/netnatm/natm.c2
-rw-r--r--sys/netnatm/natm_pcb.c2
-rw-r--r--sys/netncp/ncp_conn.c10
-rw-r--r--sys/netncp/ncp_rq.c2
-rw-r--r--sys/netncp/ncp_sock.c4
-rw-r--r--sys/netncp/ncp_subr.c2
-rw-r--r--sys/netsmb/smb_rq.c4
-rw-r--r--sys/netsmb/smb_trantcp.c2
-rw-r--r--sys/nfs4client/nfs4_dev.c4
-rw-r--r--sys/nfs4client/nfs4_idmap.c36
-rw-r--r--sys/nfs4client/nfs4_socket.c2
-rw-r--r--sys/nfs4client/nfs4_vfsops.c6
-rw-r--r--sys/nfs4client/nfs4_vn_subs.c4
-rw-r--r--sys/nfs4client/nfs4_vnops.c17
-rw-r--r--sys/nfsclient/krpc_subr.c2
-rw-r--r--sys/nfsclient/nfs_lock.c3
-rw-r--r--sys/nfsclient/nfs_node.c10
-rw-r--r--sys/nfsclient/nfs_socket.c4
-rw-r--r--sys/nfsclient/nfs_subs.c4
-rw-r--r--sys/nfsclient/nfs_vfsops.c8
-rw-r--r--sys/nfsclient/nfs_vnops.c2
-rw-r--r--sys/nfsserver/nfs_serv.c38
-rw-r--r--sys/nfsserver/nfs_srvcache.c2
-rw-r--r--sys/nfsserver/nfs_srvsock.c6
-rw-r--r--sys/nfsserver/nfs_syscalls.c16
-rw-r--r--sys/opencrypto/cryptodev.c31
-rw-r--r--sys/opencrypto/cryptosoft.c14
-rw-r--r--sys/opencrypto/deflate.c14
-rw-r--r--sys/opencrypto/xform.c28
-rw-r--r--sys/rpc/rpcclnt.c12
-rw-r--r--sys/security/mac_bsdextended/mac_bsdextended.c5
-rw-r--r--sys/security/mac_lomac/mac_lomac.c2
-rw-r--r--sys/sys/malloc.h7
-rw-r--r--sys/sys/param.h2
-rw-r--r--sys/ufs/ffs/ffs_inode.c4
-rw-r--r--sys/ufs/ffs/ffs_snapshot.c32
-rw-r--r--sys/ufs/ffs/ffs_softdep.c58
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c2
-rw-r--r--sys/ufs/ufs/ufs_dirhash.c14
-rw-r--r--sys/ufs/ufs/ufs_extattr.c11
-rw-r--r--sys/ufs/ufs/ufs_vnops.c6
217 files changed, 1001 insertions, 1073 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index df3d9d5bbe01..4fd97a6f5083 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -758,11 +758,14 @@ buildkernel:
@echo "--------------------------------------------------------------"
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR}
.endif
+.if !defined(NO_KERNELOBJ)
@echo
@echo "--------------------------------------------------------------"
@echo ">>> stage 2.2: rebuilding the object tree"
@echo "--------------------------------------------------------------"
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj
+.endif
+.if !defined(NO_KERNELTOOLS)
@echo
@echo "--------------------------------------------------------------"
@echo ">>> stage 2.3: build tools"
@@ -779,6 +782,7 @@ buildkernel:
${MAKE} -DWITHOUT_SSP -DNO_CPU_CFLAGS -DNO_CTF ${target}
.endfor
.endif
+.endif
.if !defined(NO_KERNELDEPEND)
@echo
@echo "--------------------------------------------------------------"
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 2705b6b36b83..84970aad24f4 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -741,9 +741,7 @@ MLINKS+=LOCK_PROFILING.9 MUTEX_PROFILING.9
MLINKS+=make_dev.9 destroy_dev.9 \
make_dev.9 dev_depends.9 \
make_dev.9 make_dev_alias.9
-MLINKS+=malloc.9 FREE.9 \
- malloc.9 free.9 \
- malloc.9 MALLOC.9 \
+MLINKS+=malloc.9 free.9 \
malloc.9 MALLOC_DECLARE.9 \
malloc.9 MALLOC_DEFINE.9 \
malloc.9 realloc.9 \
diff --git a/share/man/man9/malloc.9 b/share/man/man9/malloc.9
index 1061266cef64..76aa83ab4a67 100644
--- a/share/man/man9/malloc.9
+++ b/share/man/man9/malloc.9
@@ -36,14 +36,12 @@
.\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $
.\" $FreeBSD$
.\"
-.Dd June 12, 2003
+.Dd October 23, 2008
.Dt MALLOC 9
.Os
.Sh NAME
.Nm malloc ,
-.Nm MALLOC ,
.Nm free ,
-.Nm FREE ,
.Nm realloc ,
.Nm reallocf ,
.Nm MALLOC_DEFINE ,
@@ -54,10 +52,8 @@
.In sys/malloc.h
.Ft void *
.Fn malloc "unsigned long size" "struct malloc_type *type" "int flags"
-.Fn MALLOC space cast "unsigned long size" "struct malloc_type *type" "int flags"
.Ft void
.Fn free "void *addr" "struct malloc_type *type"
-.Fn FREE "void *addr" "struct malloc_type *type"
.Ft void *
.Fn realloc "void *addr" "unsigned long size" "struct malloc_type *type" "int flags"
.Ft void *
@@ -123,20 +119,6 @@ function is identical to
except that it
will free the passed pointer when the requested memory cannot be allocated.
.Pp
-The
-.Fn MALLOC
-macro variant is functionally equivalent to
-.Bd -literal -offset indent
-(space) = (cast)malloc((u_long)(size), type, flags)
-.Ed
-.Pp
-and the
-.Fn FREE
-macro variant is equivalent to
-.Bd -literal -offset indent
-free((addr), type)
-.Ed
-.Pp
Unlike its standard C library counterpart
.Pq Xr malloc 3 ,
the kernel version takes two more arguments.
@@ -219,7 +201,7 @@ MALLOC_DEFINE(M_FOOBUF, "foobuffers", "Buffers to foo data into the ether");
/* sys/something/foo_subr.c */
\&...
-MALLOC(buf, struct foo_buf *, sizeof *buf, M_FOOBUF, M_NOWAIT);
+buf = malloc(sizeof *buf, M_FOOBUF, M_NOWAIT);
.Ed
.Pp
diff --git a/sys/arm/arm/undefined.c b/sys/arm/arm/undefined.c
index 133134ef33cb..5b04c03b46ea 100644
--- a/sys/arm/arm/undefined.c
+++ b/sys/arm/arm/undefined.c
@@ -106,7 +106,7 @@ install_coproc_handler(int coproc, undef_handler_t handler)
KASSERT(handler != NULL, ("handler is NULL")); /* Used to be legal. */
/* XXX: M_TEMP??? */
- MALLOC(uh, struct undefined_handler *, sizeof(*uh), M_TEMP, M_WAITOK);
+ uh = malloc(sizeof(*uh), M_TEMP, M_WAITOK);
uh->uh_handler = handler;
install_coproc_handler_static(coproc, uh);
return uh;
@@ -125,7 +125,7 @@ remove_coproc_handler(void *cookie)
struct undefined_handler *uh = cookie;
LIST_REMOVE(uh, uh_link);
- FREE(uh, M_TEMP);
+ free(uh, M_TEMP);
}
diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c
index cb140272d53c..0b4b790db140 100644
--- a/sys/cam/scsi/scsi_target.c
+++ b/sys/cam/scsi/scsi_target.c
@@ -183,7 +183,7 @@ targopen(struct cdev *dev, int flags, int fmt, struct thread *td)
make_dev(&targ_cdevsw, dev2unit(dev), UID_ROOT, GID_WHEEL, 0600,
"targ%d", dev2unit(dev));
}
- MALLOC(softc, struct targ_softc *, sizeof(*softc), M_TARG,
+ softc = malloc(sizeof(*softc), M_TARG,
M_WAITOK | M_ZERO);
dev->si_drv1 = softc;
softc->state = TARG_STATE_OPENED;
@@ -211,7 +211,7 @@ targclose(struct cdev *dev, int flag, int fmt, struct thread *td)
if ((softc->periph == NULL) ||
(softc->state & TARG_STATE_LUN_ENABLED) == 0) {
destroy_dev(dev);
- FREE(softc, M_TARG);
+ free(softc, M_TARG);
return (0);
}
@@ -230,7 +230,7 @@ targclose(struct cdev *dev, int flag, int fmt, struct thread *td)
softc->periph = NULL;
}
destroy_dev(dev);
- FREE(softc, M_TARG);
+ free(softc, M_TARG);
}
cam_periph_unlock(periph);
cam_periph_release(periph);
@@ -531,7 +531,7 @@ targdtor(struct cam_periph *periph)
}
while ((descr = TAILQ_FIRST(&softc->abort_queue)) != NULL) {
TAILQ_REMOVE(&softc->abort_queue, descr, tqe);
- FREE(descr, M_TARG);
+ free(descr, M_TARG);
}
softc->periph = NULL;
@@ -966,7 +966,7 @@ targgetccb(struct targ_softc *softc, xpt_opcode type, int priority)
int ccb_len;
ccb_len = targccblen(type);
- MALLOC(ccb, union ccb *, ccb_len, M_TARG, M_WAITOK);
+ ccb = malloc(ccb_len, M_TARG, M_WAITOK);
CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH, ("getccb %p\n", ccb));
xpt_setup_ccb(&ccb->ccb_h, softc->path, priority);
@@ -981,13 +981,13 @@ targfreeccb(struct targ_softc *softc, union ccb *ccb)
{
CAM_DEBUG_PRINT(CAM_DEBUG_PERIPH, ("targfreeccb descr %p and\n",
ccb->ccb_h.targ_descr));
- FREE(ccb->ccb_h.targ_descr, M_TARG);
+ free(ccb->ccb_h.targ_descr, M_TARG);
switch (ccb->ccb_h.func_code) {
case XPT_ACCEPT_TARGET_IO:
case XPT_IMMED_NOTIFY:
CAM_DEBUG_PRINT(CAM_DEBUG_PERIPH, ("freeing ccb %p\n", ccb));
- FREE(ccb, M_TARG);
+ free(ccb, M_TARG);
break;
default:
/* Send back CCB if we got it from the periph */
@@ -998,7 +998,7 @@ targfreeccb(struct targ_softc *softc, union ccb *ccb)
} else {
CAM_DEBUG_PRINT(CAM_DEBUG_PERIPH,
("freeing ccb %p\n", ccb));
- FREE(ccb, M_TARG);
+ free(ccb, M_TARG);
}
break;
}
@@ -1009,7 +1009,7 @@ targgetdescr(struct targ_softc *softc)
{
struct targ_cmd_descr *descr;
- MALLOC(descr, struct targ_cmd_descr *, sizeof(*descr), M_TARG,
+ descr = malloc(sizeof(*descr), M_TARG,
M_WAITOK);
descr->mapinfo.num_bufs_used = 0;
return (descr);
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c
index 9f168170ff7a..df081a7f0bdf 100644
--- a/sys/compat/linux/linux_ioctl.c
+++ b/sys/compat/linux/linux_ioctl.c
@@ -2673,7 +2673,7 @@ linux_ioctl_register_handler(struct linux_ioctl_handler *h)
break;
}
if (he == NULL) {
- MALLOC(he, struct handler_element *, sizeof(*he),
+ he = malloc(sizeof(*he),
M_LINUX, M_WAITOK);
he->func = h->func;
} else
@@ -2711,7 +2711,7 @@ linux_ioctl_unregister_handler(struct linux_ioctl_handler *h)
if (he->func == h->func) {
TAILQ_REMOVE(&handlers, he, list);
sx_xunlock(&linux_ioctl_sx);
- FREE(he, M_LINUX);
+ free(he, M_LINUX);
return (0);
}
}
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c
index 24a7a81cec8e..57051aae7cb0 100644
--- a/sys/compat/linux/linux_socket.c
+++ b/sys/compat/linux/linux_socket.c
@@ -120,7 +120,7 @@ do_sa_get(struct sockaddr **sap, const struct osockaddr *osa, int *osalen,
}
#endif
- MALLOC(kosa, struct osockaddr *, alloclen, mtype, M_WAITOK);
+ kosa = malloc(alloclen, mtype, M_WAITOK);
if ((error = copyin(osa, kosa, *osalen)))
goto out;
@@ -168,7 +168,7 @@ do_sa_get(struct sockaddr **sap, const struct osockaddr *osa, int *osalen,
return (0);
out:
- FREE(kosa, mtype);
+ free(kosa, mtype);
return (error);
}
@@ -458,7 +458,7 @@ linux_sendit(struct thread *td, int s, struct msghdr *mp, int flags,
bad:
if (to)
- FREE(to, M_SONAME);
+ free(to, M_SONAME);
return (error);
}
diff --git a/sys/compat/linux/linux_util.c b/sys/compat/linux/linux_util.c
index 51a0ec3c947b..3412c370b419 100644
--- a/sys/compat/linux/linux_util.c
+++ b/sys/compat/linux/linux_util.c
@@ -165,7 +165,7 @@ linux_get_char_devices()
char formated[256];
int current_size = 0, string_size = 1024;
- MALLOC(string, char *, string_size, M_LINUX, M_WAITOK);
+ string = malloc(string_size, M_LINUX, M_WAITOK);
string[0] = '\000';
last = "";
TAILQ_FOREACH(de, &devices, list) {
@@ -181,10 +181,10 @@ linux_get_char_devices()
if (strlen(formated) + current_size
>= string_size) {
string_size *= 2;
- MALLOC(string, char *, string_size,
+ string = malloc(string_size,
M_LINUX, M_WAITOK);
bcopy(temp, string, current_size);
- FREE(temp, M_LINUX);
+ free(temp, M_LINUX);
}
strcat(string, formated);
current_size = strlen(string);
@@ -197,7 +197,7 @@ linux_get_char_devices()
void
linux_free_get_char_devices(char *string)
{
- FREE(string, M_LINUX);
+ free(string, M_LINUX);
}
static int linux_major_starting = 200;
@@ -210,7 +210,7 @@ linux_device_register_handler(struct linux_device_handler *d)
if (d == NULL)
return (EINVAL);
- MALLOC(de, struct device_element *, sizeof(*de),
+ de = malloc(sizeof(*de),
M_LINUX, M_WAITOK);
if (d->linux_major < 0) {
d->linux_major = linux_major_starting++;
@@ -234,7 +234,7 @@ linux_device_unregister_handler(struct linux_device_handler *d)
TAILQ_FOREACH(de, &devices, list) {
if (bcmp(d, &de->entry, sizeof(*d)) == 0) {
TAILQ_REMOVE(&devices, de, list);
- FREE(de, M_LINUX);
+ free(de, M_LINUX);
return (0);
}
}
diff --git a/sys/contrib/altq/altq/altq_cbq.c b/sys/contrib/altq/altq/altq_cbq.c
index 7cdfb4085d24..ca035dea994c 100644
--- a/sys/contrib/altq/altq/altq_cbq.c
+++ b/sys/contrib/altq/altq/altq_cbq.c
@@ -273,7 +273,7 @@ cbq_add_altq(struct pf_altq *a)
return (ENODEV);
/* allocate and initialize cbq_state_t */
- MALLOC(cbqp, cbq_state_t *, sizeof(cbq_state_t), M_DEVBUF, M_WAITOK);
+ cbqp = malloc(sizeof(cbq_state_t), M_DEVBUF, M_WAITOK);
if (cbqp == NULL)
return (ENOMEM);
bzero(cbqp, sizeof(cbq_state_t));
@@ -304,7 +304,7 @@ cbq_remove_altq(struct pf_altq *a)
cbq_class_destroy(cbqp, cbqp->ifnp.root_);
/* deallocate cbq_state_t */
- FREE(cbqp, M_DEVBUF);
+ free(cbqp, M_DEVBUF);
return (0);
}
@@ -927,7 +927,7 @@ cbq_ifattach(ifacep)
return (ENXIO);
/* allocate and initialize cbq_state_t */
- MALLOC(new_cbqp, cbq_state_t *, sizeof(cbq_state_t), M_DEVBUF, M_WAITOK);
+ new_cbqp = malloc(sizeof(cbq_state_t), M_DEVBUF, M_WAITOK);
if (new_cbqp == NULL)
return (ENOMEM);
bzero(new_cbqp, sizeof(cbq_state_t));
@@ -943,7 +943,7 @@ cbq_ifattach(ifacep)
cbq_enqueue, cbq_dequeue, cbq_request,
&new_cbqp->cbq_classifier, acc_classify);
if (error) {
- FREE(new_cbqp, M_DEVBUF);
+ free(new_cbqp, M_DEVBUF);
return (error);
}
@@ -987,7 +987,7 @@ cbq_ifdetach(ifacep)
}
/* deallocate cbq_state_t */
- FREE(cbqp, M_DEVBUF);
+ free(cbqp, M_DEVBUF);
return (0);
}
diff --git a/sys/contrib/altq/altq/altq_cdnr.c b/sys/contrib/altq/altq/altq_cdnr.c
index 3139d51d95b5..b4f906542a8c 100644
--- a/sys/contrib/altq/altq/altq_cdnr.c
+++ b/sys/contrib/altq/altq/altq_cdnr.c
@@ -274,7 +274,7 @@ cdnr_cballoc(top, type, input_func)
return (NULL);
}
- MALLOC(cb, struct cdnr_block *, size, M_DEVBUF, M_WAITOK);
+ cb = malloc(size, M_DEVBUF, M_WAITOK);
if (cb == NULL)
return (NULL);
bzero(cb, size);
@@ -319,7 +319,7 @@ cdnr_cbdestroy(cblock)
if (cb->cb_top != cblock)
LIST_REMOVE(cb, cb_next);
- FREE(cb, M_DEVBUF);
+ free(cb, M_DEVBUF);
}
/*
diff --git a/sys/contrib/altq/altq/altq_hfsc.c b/sys/contrib/altq/altq/altq_hfsc.c
index bf7a4f09a119..8beead7cf0d5 100644
--- a/sys/contrib/altq/altq/altq_hfsc.c
+++ b/sys/contrib/altq/altq/altq_hfsc.c
@@ -202,7 +202,7 @@ hfsc_add_altq(struct pf_altq *a)
if (!ALTQ_IS_READY(&ifp->if_snd))
return (ENODEV);
- MALLOC(hif, struct hfsc_if *, sizeof(struct hfsc_if),
+ hif = malloc(sizeof(struct hfsc_if),
M_DEVBUF, M_WAITOK);
if (hif == NULL)
return (ENOMEM);
@@ -210,7 +210,7 @@ hfsc_add_altq(struct pf_altq *a)
hif->hif_eligible = ellist_alloc();
if (hif->hif_eligible == NULL) {
- FREE(hif, M_DEVBUF);
+ free(hif, M_DEVBUF);
return (ENOMEM);
}
@@ -236,7 +236,7 @@ hfsc_remove_altq(struct pf_altq *a)
ellist_destroy(hif->hif_eligible);
- FREE(hif, M_DEVBUF);
+ free(hif, M_DEVBUF);
return (0);
}
@@ -404,13 +404,13 @@ hfsc_class_create(struct hfsc_if *hif, struct service_curve *rsc,
}
#endif
- MALLOC(cl, struct hfsc_class *, sizeof(struct hfsc_class),
+ cl = malloc(sizeof(struct hfsc_class),
M_DEVBUF, M_WAITOK);
if (cl == NULL)
return (NULL);
bzero(cl, sizeof(struct hfsc_class));
- MALLOC(cl->cl_q, class_queue_t *, sizeof(class_queue_t),
+ cl->cl_q = malloc(sizeof(class_queue_t),
M_DEVBUF, M_WAITOK);
if (cl->cl_q == NULL)
goto err_ret;
@@ -471,8 +471,7 @@ hfsc_class_create(struct hfsc_if *hif, struct service_curve *rsc,
#endif /* ALTQ_RED */
if (rsc != NULL && (rsc->m1 != 0 || rsc->m2 != 0)) {
- MALLOC(cl->cl_rsc, struct internal_sc *,
- sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
+ cl->cl_rsc = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
if (cl->cl_rsc == NULL)
goto err_ret;
sc2isc(rsc, cl->cl_rsc);
@@ -480,16 +479,14 @@ hfsc_class_create(struct hfsc_if *hif, struct service_curve *rsc,
rtsc_init(&cl->cl_eligible, cl->cl_rsc, 0, 0);
}
if (fsc != NULL && (fsc->m1 != 0 || fsc->m2 != 0)) {
- MALLOC(cl->cl_fsc, struct internal_sc *,
- sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
+ cl->cl_fsc = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
if (cl->cl_fsc == NULL)
goto err_ret;
sc2isc(fsc, cl->cl_fsc);
rtsc_init(&cl->cl_virtual, cl->cl_fsc, 0, 0);
}
if (usc != NULL && (usc->m1 != 0 || usc->m2 != 0)) {
- MALLOC(cl->cl_usc, struct internal_sc *,
- sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
+ cl->cl_usc = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
if (cl->cl_usc == NULL)
goto err_ret;
sc2isc(usc, cl->cl_usc);
@@ -565,14 +562,14 @@ hfsc_class_create(struct hfsc_if *hif, struct service_curve *rsc,
#endif
}
if (cl->cl_fsc != NULL)
- FREE(cl->cl_fsc, M_DEVBUF);
+ free(cl->cl_fsc, M_DEVBUF);
if (cl->cl_rsc != NULL)
- FREE(cl->cl_rsc, M_DEVBUF);
+ free(cl->cl_rsc, M_DEVBUF);
if (cl->cl_usc != NULL)
- FREE(cl->cl_usc, M_DEVBUF);
+ free(cl->cl_usc, M_DEVBUF);
if (cl->cl_q != NULL)
- FREE(cl->cl_q, M_DEVBUF);
- FREE(cl, M_DEVBUF);
+ free(cl->cl_q, M_DEVBUF);
+ free(cl, M_DEVBUF);
return (NULL);
}
@@ -649,13 +646,13 @@ hfsc_class_destroy(struct hfsc_class *cl)
IFQ_UNLOCK(cl->cl_hif->hif_ifq);
if (cl->cl_usc != NULL)
- FREE(cl->cl_usc, M_DEVBUF);
+ free(cl->cl_usc, M_DEVBUF);
if (cl->cl_fsc != NULL)
- FREE(cl->cl_fsc, M_DEVBUF);
+ free(cl->cl_fsc, M_DEVBUF);
if (cl->cl_rsc != NULL)
- FREE(cl->cl_rsc, M_DEVBUF);
- FREE(cl->cl_q, M_DEVBUF);
- FREE(cl, M_DEVBUF);
+ free(cl->cl_rsc, M_DEVBUF);
+ free(cl->cl_q, M_DEVBUF);
+ free(cl, M_DEVBUF);
return (0);
}
@@ -1203,7 +1200,7 @@ ellist_alloc(void)
{
ellist_t *head;
- MALLOC(head, ellist_t *, sizeof(ellist_t), M_DEVBUF, M_WAITOK);
+ head = malloc(sizeof(ellist_t), M_DEVBUF, M_WAITOK);
TAILQ_INIT(head);
return (head);
}
@@ -1211,7 +1208,7 @@ ellist_alloc(void)
static void
ellist_destroy(ellist_t *head)
{
- FREE(head, M_DEVBUF);
+ free(head, M_DEVBUF);
}
static void
@@ -1306,7 +1303,7 @@ actlist_alloc(void)
{
actlist_t *head;
- MALLOC(head, actlist_t *, sizeof(actlist_t), M_DEVBUF, M_WAITOK);
+ head = malloc(sizeof(actlist_t), M_DEVBUF, M_WAITOK);
TAILQ_INIT(head);
return (head);
}
@@ -1314,7 +1311,7 @@ actlist_alloc(void)
static void
actlist_destroy(actlist_t *head)
{
- FREE(head, M_DEVBUF);
+ free(head, M_DEVBUF);
}
static void
actlist_insert(struct hfsc_class *cl)
@@ -1743,7 +1740,7 @@ hfsc_attach(ifq, bandwidth)
{
struct hfsc_if *hif;
- MALLOC(hif, struct hfsc_if *, sizeof(struct hfsc_if),
+ hif = malloc(sizeof(struct hfsc_if),
M_DEVBUF, M_WAITOK);
if (hif == NULL)
return (NULL);
@@ -1751,7 +1748,7 @@ hfsc_attach(ifq, bandwidth)
hif->hif_eligible = ellist_alloc();
if (hif->hif_eligible == NULL) {
- FREE(hif, M_DEVBUF);
+ free(hif, M_DEVBUF);
return NULL;
}
@@ -1787,7 +1784,7 @@ hfsc_detach(hif)
ellist_destroy(hif->hif_eligible);
- FREE(hif, M_DEVBUF);
+ free(hif, M_DEVBUF);
return (0);
}
@@ -1804,22 +1801,19 @@ hfsc_class_modify(cl, rsc, fsc, usc)
rsc_tmp = fsc_tmp = usc_tmp = NULL;
if (rsc != NULL && (rsc->m1 != 0 || rsc->m2 != 0) &&
cl->cl_rsc == NULL) {
- MALLOC(rsc_tmp, struct internal_sc *,
- sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
+ rsc_tmp = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
if (rsc_tmp == NULL)
return (ENOMEM);
}
if (fsc != NULL && (fsc->m1 != 0 || fsc->m2 != 0) &&
cl->cl_fsc == NULL) {
- MALLOC(fsc_tmp, struct internal_sc *,
- sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
+ fsc_tmp = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
if (fsc_tmp == NULL)
return (ENOMEM);
}
if (usc != NULL && (usc->m1 != 0 || usc->m2 != 0) &&
cl->cl_usc == NULL) {
- MALLOC(usc_tmp, struct internal_sc *,
- sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
+ usc_tmp = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK);
if (usc_tmp == NULL)
return (ENOMEM);
}
@@ -1837,7 +1831,7 @@ hfsc_class_modify(cl, rsc, fsc, usc)
if (cl->cl_rsc != NULL) {
if (!qempty(cl->cl_q))
hfsc_purgeq(cl);
- FREE(cl->cl_rsc, M_DEVBUF);
+ free(cl->cl_rsc, M_DEVBUF);
cl->cl_rsc = NULL;
}
} else {
@@ -1859,7 +1853,7 @@ hfsc_class_modify(cl, rsc, fsc, usc)
if (cl->cl_fsc != NULL) {
if (!qempty(cl->cl_q))
hfsc_purgeq(cl);
- FREE(cl->cl_fsc, M_DEVBUF);
+ free(cl->cl_fsc, M_DEVBUF);
cl->cl_fsc = NULL;
}
} else {
@@ -1874,7 +1868,7 @@ hfsc_class_modify(cl, rsc, fsc, usc)
if (usc != NULL) {
if (usc->m1 == 0 && usc->m2 == 0) {
if (cl->cl_usc != NULL) {
- FREE(cl->cl_usc, M_DEVBUF);
+ free(cl->cl_usc, M_DEVBUF);
cl->cl_usc = NULL;
cl->cl_myf = 0;
}
diff --git a/sys/contrib/altq/altq/altq_priq.c b/sys/contrib/altq/altq/altq_priq.c
index ec789c5a926d..ce9bdbcaceb8 100644
--- a/sys/contrib/altq/altq/altq_priq.c
+++ b/sys/contrib/altq/altq/altq_priq.c
@@ -134,7 +134,7 @@ priq_add_altq(struct pf_altq *a)
if (!ALTQ_IS_READY(&ifp->if_snd))
return (ENODEV);
- MALLOC(pif, struct priq_if *, sizeof(struct priq_if),
+ pif = malloc(sizeof(struct priq_if),
M_DEVBUF, M_WAITOK);
if (pif == NULL)
return (ENOMEM);
@@ -160,7 +160,7 @@ priq_remove_altq(struct pf_altq *a)
(void)priq_clear_interface(pif);
- FREE(pif, M_DEVBUF);
+ free(pif, M_DEVBUF);
return (0);
}
@@ -320,13 +320,13 @@ priq_class_create(struct priq_if *pif, int pri, int qlimit, int flags, int qid)
red_destroy(cl->cl_red);
#endif
} else {
- MALLOC(cl, struct priq_class *, sizeof(struct priq_class),
+ cl = malloc(sizeof(struct priq_class),
M_DEVBUF, M_WAITOK);
if (cl == NULL)
return (NULL);
bzero(cl, sizeof(struct priq_class));
- MALLOC(cl->cl_q, class_queue_t *, sizeof(class_queue_t),
+ cl->cl_q = malloc(sizeof(class_queue_t),
M_DEVBUF, M_WAITOK);
if (cl->cl_q == NULL)
goto err_ret;
@@ -397,8 +397,8 @@ priq_class_create(struct priq_if *pif, int pri, int qlimit, int flags, int qid)
#endif
}
if (cl->cl_q != NULL)
- FREE(cl->cl_q, M_DEVBUF);
- FREE(cl, M_DEVBUF);
+ free(cl->cl_q, M_DEVBUF);
+ free(cl, M_DEVBUF);
return (NULL);
}
@@ -447,8 +447,8 @@ priq_class_destroy(struct priq_class *cl)
red_destroy(cl->cl_red);
#endif
}
- FREE(cl->cl_q, M_DEVBUF);
- FREE(cl, M_DEVBUF);
+ free(cl->cl_q, M_DEVBUF);
+ free(cl, M_DEVBUF);
return (0);
}
@@ -666,7 +666,7 @@ priq_attach(ifq, bandwidth)
{
struct priq_if *pif;
- MALLOC(pif, struct priq_if *, sizeof(struct priq_if),
+ pif = malloc(sizeof(struct priq_if),
M_DEVBUF, M_WAITOK);
if (pif == NULL)
return (NULL);
@@ -702,7 +702,7 @@ priq_detach(pif)
ASSERT(p != NULL);
}
- FREE(pif, M_DEVBUF);
+ free(pif, M_DEVBUF);
return (0);
}
diff --git a/sys/contrib/altq/altq/altq_red.c b/sys/contrib/altq/altq/altq_red.c
index f6b7e3137e67..2804cee94602 100644
--- a/sys/contrib/altq/altq/altq_red.c
+++ b/sys/contrib/altq/altq/altq_red.c
@@ -233,7 +233,7 @@ red_alloc(int weight, int inv_pmax, int th_min, int th_max, int flags,
int w, i;
int npkts_per_sec;
- MALLOC(rp, red_t *, sizeof(red_t), M_DEVBUF, M_WAITOK);
+ rp = malloc(sizeof(red_t), M_DEVBUF, M_WAITOK);
if (rp == NULL)
return (NULL);
bzero(rp, sizeof(red_t));
@@ -321,7 +321,7 @@ red_destroy(red_t *rp)
#endif
#endif /* ALTQ3_COMPAT */
wtab_destroy(rp->red_wtab);
- FREE(rp, M_DEVBUF);
+ free(rp, M_DEVBUF);
}
void
@@ -646,7 +646,7 @@ wtab_alloc(int weight)
return (w);
}
- MALLOC(w, struct wtab *, sizeof(struct wtab), M_DEVBUF, M_WAITOK);
+ w = malloc(sizeof(struct wtab), M_DEVBUF, M_WAITOK);
if (w == NULL)
panic("wtab_alloc: malloc failed!");
bzero(w, sizeof(struct wtab));
@@ -682,7 +682,7 @@ wtab_destroy(struct wtab *w)
break;
}
- FREE(w, M_DEVBUF);
+ free(w, M_DEVBUF);
return (0);
}
@@ -816,17 +816,17 @@ redioctl(dev, cmd, addr, flag, p)
}
/* allocate and initialize red_queue_t */
- MALLOC(rqp, red_queue_t *, sizeof(red_queue_t), M_DEVBUF, M_WAITOK);
+ rqp = malloc(sizeof(red_queue_t), M_DEVBUF, M_WAITOK);
if (rqp == NULL) {
error = ENOMEM;
break;
}
bzero(rqp, sizeof(red_queue_t));
- MALLOC(rqp->rq_q, class_queue_t *, sizeof(class_queue_t),
+ rqp->rq_q = malloc(sizeof(class_queue_t),
M_DEVBUF, M_WAITOK);
if (rqp->rq_q == NULL) {
- FREE(rqp, M_DEVBUF);
+ free(rqp, M_DEVBUF);
error = ENOMEM;
break;
}
@@ -834,8 +834,8 @@ redioctl(dev, cmd, addr, flag, p)
rqp->rq_red = red_alloc(0, 0, 0, 0, 0, 0);
if (rqp->rq_red == NULL) {
- FREE(rqp->rq_q, M_DEVBUF);
- FREE(rqp, M_DEVBUF);
+ free(rqp->rq_q, M_DEVBUF);
+ free(rqp, M_DEVBUF);
error = ENOMEM;
break;
}
@@ -854,8 +854,8 @@ redioctl(dev, cmd, addr, flag, p)
NULL, NULL);
if (error) {
red_destroy(rqp->rq_red);
- FREE(rqp->rq_q, M_DEVBUF);
- FREE(rqp, M_DEVBUF);
+ free(rqp->rq_q, M_DEVBUF);
+ free(rqp, M_DEVBUF);
break;
}
@@ -1016,8 +1016,8 @@ red_detach(rqp)
}
red_destroy(rqp->rq_red);
- FREE(rqp->rq_q, M_DEVBUF);
- FREE(rqp, M_DEVBUF);
+ free(rqp->rq_q, M_DEVBUF);
+ free(rqp, M_DEVBUF);
return (error);
}
@@ -1297,16 +1297,16 @@ fv_alloc(rp)
int i, num;
num = FV_FLOWLISTSIZE;
- MALLOC(fv, struct flowvalve *, sizeof(struct flowvalve),
+ fv = malloc(sizeof(struct flowvalve),
M_DEVBUF, M_WAITOK);
if (fv == NULL)
return (NULL);
bzero(fv, sizeof(struct flowvalve));
- MALLOC(fv->fv_fves, struct fve *, sizeof(struct fve) * num,
+ fv->fv_fves = malloc(sizeof(struct fve) * num,
M_DEVBUF, M_WAITOK);
if (fv->fv_fves == NULL) {
- FREE(fv, M_DEVBUF);
+ free(fv, M_DEVBUF);
return (NULL);
}
bzero(fv->fv_fves, sizeof(struct fve) * num);
@@ -1323,11 +1323,11 @@ fv_alloc(rp)
fv->fv_pthresh = (FV_PSCALE(1) << FP_SHIFT) / rp->red_inv_pmax;
/* initialize drop rate to fraction table */
- MALLOC(fv->fv_p2ftab, int *, sizeof(int) * BRTT_SIZE,
+ fv->fv_p2ftab = malloc(sizeof(int) * BRTT_SIZE,
M_DEVBUF, M_WAITOK);
if (fv->fv_p2ftab == NULL) {
- FREE(fv->fv_fves, M_DEVBUF);
- FREE(fv, M_DEVBUF);
+ free(fv->fv_fves, M_DEVBUF);
+ free(fv, M_DEVBUF);
return (NULL);
}
/*
@@ -1348,9 +1348,9 @@ fv_alloc(rp)
static void fv_destroy(fv)
struct flowvalve *fv;
{
- FREE(fv->fv_p2ftab, M_DEVBUF);
- FREE(fv->fv_fves, M_DEVBUF);
- FREE(fv, M_DEVBUF);
+ free(fv->fv_p2ftab, M_DEVBUF);
+ free(fv->fv_fves, M_DEVBUF);
+ free(fv, M_DEVBUF);
}
static __inline int
diff --git a/sys/contrib/altq/altq/altq_rio.c b/sys/contrib/altq/altq/altq_rio.c
index a05dba712520..09599c26da5b 100644
--- a/sys/contrib/altq/altq/altq_rio.c
+++ b/sys/contrib/altq/altq/altq_rio.c
@@ -206,7 +206,7 @@ rio_alloc(int weight, struct redparams *params, int flags, int pkttime)
int w, i;
int npkts_per_sec;
- MALLOC(rp, rio_t *, sizeof(rio_t), M_DEVBUF, M_WAITOK);
+ rp = malloc(sizeof(rio_t), M_DEVBUF, M_WAITOK);
if (rp == NULL)
return (NULL);
bzero(rp, sizeof(rio_t));
@@ -293,7 +293,7 @@ void
rio_destroy(rio_t *rp)
{
wtab_destroy(rp->rio_wtab);
- FREE(rp, M_DEVBUF);
+ free(rp, M_DEVBUF);
}
void
@@ -572,17 +572,17 @@ rioioctl(dev, cmd, addr, flag, p)
}
/* allocate and initialize rio_queue_t */
- MALLOC(rqp, rio_queue_t *, sizeof(rio_queue_t), M_DEVBUF, M_WAITOK);
+ rqp = malloc(sizeof(rio_queue_t), M_DEVBUF, M_WAITOK);
if (rqp == NULL) {
error = ENOMEM;
break;
}
bzero(rqp, sizeof(rio_queue_t));
- MALLOC(rqp->rq_q, class_queue_t *, sizeof(class_queue_t),
+ rqp->rq_q = malloc(sizeof(class_queue_t),
M_DEVBUF, M_WAITOK);
if (rqp->rq_q == NULL) {
- FREE(rqp, M_DEVBUF);
+ free(rqp, M_DEVBUF);
error = ENOMEM;
break;
}
@@ -590,8 +590,8 @@ rioioctl(dev, cmd, addr, flag, p)
rqp->rq_rio = rio_alloc(0, NULL, 0, 0);
if (rqp->rq_rio == NULL) {
- FREE(rqp->rq_q, M_DEVBUF);
- FREE(rqp, M_DEVBUF);
+ free(rqp->rq_q, M_DEVBUF);
+ free(rqp, M_DEVBUF);
error = ENOMEM;
break;
}
@@ -610,8 +610,8 @@ rioioctl(dev, cmd, addr, flag, p)
NULL, NULL);
if (error) {
rio_destroy(rqp->rq_rio);
- FREE(rqp->rq_q, M_DEVBUF);
- FREE(rqp, M_DEVBUF);
+ free(rqp->rq_q, M_DEVBUF);
+ free(rqp, M_DEVBUF);
break;
}
@@ -759,8 +759,8 @@ rio_detach(rqp)
}
rio_destroy(rqp->rq_rio);
- FREE(rqp->rq_q, M_DEVBUF);
- FREE(rqp, M_DEVBUF);
+ free(rqp->rq_q, M_DEVBUF);
+ free(rqp, M_DEVBUF);
return (error);
}
diff --git a/sys/contrib/altq/altq/altq_rmclass.c b/sys/contrib/altq/altq/altq_rmclass.c
index 63194ee13169..94c53f1c6f5a 100644
--- a/sys/contrib/altq/altq/altq_rmclass.c
+++ b/sys/contrib/altq/altq/altq_rmclass.c
@@ -220,16 +220,16 @@ rmc_newclass(int pri, struct rm_ifdat *ifd, u_int nsecPerByte,
}
#endif
- MALLOC(cl, struct rm_class *, sizeof(struct rm_class),
+ cl = malloc(sizeof(struct rm_class),
M_DEVBUF, M_WAITOK);
if (cl == NULL)
return (NULL);
bzero(cl, sizeof(struct rm_class));
CALLOUT_INIT(&cl->callout_);
- MALLOC(cl->q_, class_queue_t *, sizeof(class_queue_t),
+ cl->q_ = malloc(sizeof(class_queue_t),
M_DEVBUF, M_WAITOK);
if (cl->q_ == NULL) {
- FREE(cl, M_DEVBUF);
+ free(cl, M_DEVBUF);
return (NULL);
}
bzero(cl->q_, sizeof(class_queue_t));
@@ -658,8 +658,8 @@ rmc_delete_class(struct rm_ifdat *ifd, struct rm_class *cl)
red_destroy(cl->red_);
#endif
}
- FREE(cl->q_, M_DEVBUF);
- FREE(cl, M_DEVBUF);
+ free(cl->q_, M_DEVBUF);
+ free(cl, M_DEVBUF);
}
diff --git a/sys/contrib/altq/altq/altq_subr.c b/sys/contrib/altq/altq/altq_subr.c
index ab945eb4fa0d..0dd1801e82ae 100644
--- a/sys/contrib/altq/altq/altq_subr.c
+++ b/sys/contrib/altq/altq/altq_subr.c
@@ -397,13 +397,13 @@ tbr_set(ifq, profile)
return (ENOENT);
}
ifq->altq_tbr = NULL;
- FREE(tbr, M_DEVBUF);
+ free(tbr, M_DEVBUF);
IFQ_UNLOCK(ifq);
return (0);
}
IFQ_UNLOCK(ifq);
- MALLOC(tbr, struct tb_regulator *, sizeof(struct tb_regulator),
+ tbr = malloc(sizeof(struct tb_regulator),
M_DEVBUF, M_WAITOK);
if (tbr == NULL) { /* can not happen */
IFQ_UNLOCK(ifq);
@@ -426,7 +426,7 @@ tbr_set(ifq, profile)
ifq->altq_tbr = tbr; /* set the new tbr */
if (otbr != NULL)
- FREE(otbr, M_DEVBUF);
+ free(otbr, M_DEVBUF);
else {
if (tbr_timer == 0) {
CALLOUT_RESET(&tbr_callout, 1, tbr_timeout, (void *)0);
@@ -1402,7 +1402,7 @@ acc_add_filter(classifier, filter, class, phandle)
return (EINVAL);
#endif
- MALLOC(afp, struct acc_filter *, sizeof(struct acc_filter),
+ afp = malloc(sizeof(struct acc_filter),
M_DEVBUF, M_WAITOK);
if (afp == NULL)
return (ENOMEM);
@@ -1529,7 +1529,7 @@ acc_delete_filter(classifier, handle)
LIST_REMOVE(afp, f_chain);
splx(s);
- FREE(afp, M_DEVBUF);
+ free(afp, M_DEVBUF);
/* todo: update filt_bmask */
@@ -1559,7 +1559,7 @@ acc_discard_filters(classifier, class, all)
LIST_FOREACH(afp, &classifier->acc_filters[i], f_chain)
if (all || afp->f_class == class) {
LIST_REMOVE(afp, f_chain);
- FREE(afp, M_DEVBUF);
+ free(afp, M_DEVBUF);
/* start again from the head */
break;
}
@@ -1981,7 +1981,7 @@ ip4f_init(void)
TAILQ_INIT(&ip4f_list);
for (i=0; i<IP4F_TABSIZE; i++) {
- MALLOC(fp, struct ip4_frag *, sizeof(struct ip4_frag),
+ fp = malloc(sizeof(struct ip4_frag),
M_DEVBUF, M_NOWAIT);
if (fp == NULL) {
printf("ip4f_init: can't alloc %dth entry!\n", i);
diff --git a/sys/contrib/ipfilter/netinet/ip_compat.h b/sys/contrib/ipfilter/netinet/ip_compat.h
index 6f05720c85c8..31e5b114e002 100644
--- a/sys/contrib/ipfilter/netinet/ip_compat.h
+++ b/sys/contrib/ipfilter/netinet/ip_compat.h
@@ -1662,12 +1662,23 @@ MALLOC_DECLARE(M_IPFILTER);
# endif /* M_IPFILTER */
# endif /* M_PFIL */
# endif /* IPFILTER_M_IPFILTER */
-# define KMALLOC(a, b) MALLOC((a), b, sizeof(*(a)), _M_IPF, M_NOWAIT)
-# if !defined(KMALLOCS)
-# define KMALLOCS(a, b, c) MALLOC((a), b, (c), _M_IPF, M_NOWAIT)
+# if defined(__FreeBSD__) && __FreeBSD_version >= 800051
+# define KMALLOC(a, b) do { \
+ a = (b)malloc(sizeof(*(a)), _M_IPF, M_NOWAIT); \
+ } while (0)
+# define KMALLOCS(a, b, c) do { \
+ a = (b)malloc((c), _M_IPF, ((c) > 4096) ? M_WAITOK : M_NOWAIT); \
+ } while (0)
+# define KFREE(x) free((x), _M_IPF)
+# define KFREES(x,s) free((x), _M_IPF)
+# else
+# define KMALLOC(a, b) MALLOC((a), b, sizeof(*(a)), _M_IPF, M_NOWAIT)
+# if !defined(KMALLOCS)
+# define KMALLOCS(a, b, c) MALLOC((a), b, (c), _M_IPF, M_NOWAIT)
+# endif
+# define KFREE(x) FREE((x), _M_IPF)
+# define KFREES(x,s) FREE((x), _M_IPF)
# endif
-# define KFREE(x) FREE((x), _M_IPF)
-# define KFREES(x,s) FREE((x), _M_IPF)
# define UIOMOVE(a,b,c,d) uiomove((caddr_t)a,b,d)
# define SLEEP(id, n) tsleep((id), PPAUSE|PCATCH, n, 0)
# define WAKEUP(id,x) wakeup(id+x)
diff --git a/sys/dev/ar/if_ar.c b/sys/dev/ar/if_ar.c
index 35756e4f6395..55411d813c0e 100644
--- a/sys/dev/ar/if_ar.c
+++ b/sys/dev/ar/if_ar.c
@@ -365,7 +365,7 @@ ar_detach(device_t device)
* deallocate any system resources we may have
* allocated on behalf of this driver.
*/
- FREE(hc->sc, M_DEVBUF);
+ free(hc->sc, M_DEVBUF);
hc->sc = NULL;
hc->mem_start = NULL;
return (ar_deallocate_resources(device));
@@ -1071,7 +1071,7 @@ arc_init(struct ar_hardc *hc)
u_char isr, mar;
u_long memst;
- MALLOC(sc, struct ar_softc *, hc->numports * sizeof(struct ar_softc),
+ sc = malloc(hc->numports * sizeof(struct ar_softc),
M_DEVBUF, M_WAITOK | M_ZERO);
if (sc == NULL)
return;
diff --git a/sys/dev/ce/if_ce.c b/sys/dev/ce/if_ce.c
index 9b0d69cbecd4..7b3ff872d681 100644
--- a/sys/dev/ce/if_ce.c
+++ b/sys/dev/ce/if_ce.c
@@ -2366,8 +2366,7 @@ static int ng_ce_rcvmsg (node_p node, struct ng_mesg *msg,
break;
}
#else
- MALLOC (resp, struct ng_mesg *, dl,
- M_NETGRAPH, M_NOWAIT);
+ resp = malloc (M_NETGRAPH, M_NOWAIT);
if (! resp) {
error = ENOMEM;
break;
@@ -2400,7 +2399,7 @@ static int ng_ce_rcvmsg (node_p node, struct ng_mesg *msg,
NG_FREE_MSG (msg);
#else
*rptr = resp;
- FREE (msg, M_NETGRAPH);
+ free (msg, M_NETGRAPH);
#endif
return error;
}
diff --git a/sys/dev/hwpmc/hwpmc_amd.c b/sys/dev/hwpmc/hwpmc_amd.c
index 4477173e73c5..fd4c5bc007d2 100644
--- a/sys/dev/hwpmc/hwpmc_amd.c
+++ b/sys/dev/hwpmc/hwpmc_amd.c
@@ -838,7 +838,7 @@ amd_init(int cpu)
PMCDBG(MDP,INI,1,"amd-init cpu=%d", cpu);
- MALLOC(pcs, struct amd_cpu *, sizeof(struct amd_cpu), M_PMC,
+ pcs = malloc(sizeof(struct amd_cpu), M_PMC,
M_WAITOK|M_ZERO);
phw = &pcs->pc_amdpmcs[0];
@@ -911,7 +911,7 @@ amd_cleanup(int cpu)
#endif
pmc_pcpu[cpu] = NULL;
- FREE(pcs, M_PMC);
+ free(pcs, M_PMC);
return 0;
}
@@ -960,7 +960,7 @@ pmc_amd_initialize(void)
amd_pmc_class = class;
#endif
- MALLOC(pmc_mdep, struct pmc_mdep *, sizeof(struct pmc_mdep),
+ pmc_mdep = malloc(sizeof(struct pmc_mdep),
M_PMC, M_WAITOK|M_ZERO);
pmc_mdep->pmd_cputype = cputype;
diff --git a/sys/dev/hwpmc/hwpmc_logging.c b/sys/dev/hwpmc/hwpmc_logging.c
index 77417aff8177..8f1ca01cec28 100644
--- a/sys/dev/hwpmc/hwpmc_logging.c
+++ b/sys/dev/hwpmc/hwpmc_logging.c
@@ -973,7 +973,7 @@ pmclog_initialize()
/* create global pool of log buffers */
for (n = 0; n < pmc_nlogbuffers; n++) {
- MALLOC(plb, struct pmclog_buffer *, 1024 * pmclog_buffer_size,
+ plb = malloc(1024 * pmclog_buffer_size,
M_PMC, M_ZERO|M_WAITOK);
PMCLOG_INIT_BUFFER_DESCRIPTOR(plb);
TAILQ_INSERT_HEAD(&pmc_bufferlist, plb, plb_next);
@@ -999,6 +999,6 @@ pmclog_shutdown()
while ((plb = TAILQ_FIRST(&pmc_bufferlist)) != NULL) {
TAILQ_REMOVE(&pmc_bufferlist, plb, plb_next);
- FREE(plb, M_PMC);
+ free(plb, M_PMC);
}
}
diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c
index dbf732ba8fa6..3bda5ba2845a 100644
--- a/sys/dev/hwpmc/hwpmc_mod.c
+++ b/sys/dev/hwpmc/hwpmc_mod.c
@@ -331,7 +331,7 @@ pmc_debugflags_parse(char *newstr, char *fence)
int error, found, *newbits, tmp;
size_t kwlen;
- MALLOC(tmpflags, struct pmc_debugflags *, sizeof(*tmpflags),
+ tmpflags = malloc(sizeof(*tmpflags),
M_PMC, M_WAITOK|M_ZERO);
p = newstr;
@@ -450,7 +450,7 @@ pmc_debugflags_parse(char *newstr, char *fence)
bcopy(tmpflags, &pmc_debugflags, sizeof(pmc_debugflags));
done:
- FREE(tmpflags, M_PMC);
+ free(tmpflags, M_PMC);
return error;
}
@@ -464,7 +464,7 @@ pmc_debugflags_sysctl_handler(SYSCTL_HANDLER_ARGS)
(void) arg1; (void) arg2; /* unused parameters */
n = sizeof(pmc_debugstr);
- MALLOC(newstr, char *, n, M_PMC, M_ZERO|M_WAITOK);
+ newstr = malloc(n, M_PMC, M_ZERO|M_WAITOK);
(void) strlcpy(newstr, pmc_debugstr, n);
error = sysctl_handle_string(oidp, newstr, n, req);
@@ -477,7 +477,7 @@ pmc_debugflags_sysctl_handler(SYSCTL_HANDLER_ARGS)
sizeof(pmc_debugstr));
}
- FREE(newstr, M_PMC);
+ free(newstr, M_PMC);
return error;
}
@@ -777,7 +777,7 @@ pmc_link_target_process(struct pmc *pm, struct pmc_process *pp)
__LINE__, pp, pm));
#endif
- MALLOC(pt, struct pmc_target *, sizeof(struct pmc_target),
+ pt = malloc(sizeof(struct pmc_target),
M_PMC, M_ZERO|M_WAITOK);
pt->pt_process = pp;
@@ -849,7 +849,7 @@ pmc_unlink_target_process(struct pmc *pm, struct pmc_process *pp)
"in pmc %p", __LINE__, pp->pp_proc, pp, pm));
LIST_REMOVE(ptgt, pt_next);
- FREE(ptgt, M_PMC);
+ free(ptgt, M_PMC);
/* if the PMC now lacks targets, send the owner a SIGIO */
if (LIST_EMPTY(&pm->pm_targets)) {
@@ -972,7 +972,7 @@ pmc_attach_one_process(struct proc *p, struct pmc *pm)
} else
pmclog_process_pmcattach(pm, p->p_pid, fullpath);
if (freepath)
- FREE(freepath, M_TEMP);
+ free(freepath, M_TEMP);
if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)))
pmc_log_process_mappings(pm->pm_owner, p);
}
@@ -1093,7 +1093,7 @@ pmc_detach_one_process(struct proc *p, struct pmc *pm, int flags)
pmc_remove_process_descriptor(pp);
if (flags & PMC_FLAG_REMOVE)
- FREE(pp, M_PMC);
+ free(pp, M_PMC);
PROC_LOCK(p);
p->p_flag &= ~P_HWPMC;
@@ -1511,7 +1511,7 @@ pmc_process_mmap(struct thread *td, struct pmckern_map_in *pkm)
done:
if (freepath)
- FREE(freepath, M_TEMP);
+ free(freepath, M_TEMP);
}
@@ -1575,7 +1575,7 @@ pmc_log_kernel_mappings(struct pmc *pm)
pmclog_process_map_in(po, (pid_t) -1, km->pm_address,
km->pm_file);
}
- FREE(kmbase, M_LINKER);
+ free(kmbase, M_LINKER);
po->po_flags |= PMC_PO_INITIAL_MAPPINGS_DONE;
}
@@ -1692,7 +1692,7 @@ pmc_hook_handler(struct thread *td, int function, void *arg)
if (!is_using_hwpmcs) {
if (freepath)
- FREE(freepath, M_TEMP);
+ free(freepath, M_TEMP);
break;
}
@@ -1712,7 +1712,7 @@ pmc_hook_handler(struct thread *td, int function, void *arg)
*/
if ((pp = pmc_find_process_descriptor(p, 0)) == NULL) {
if (freepath)
- FREE(freepath, M_TEMP);
+ free(freepath, M_TEMP);
break;
}
@@ -1732,7 +1732,7 @@ pmc_hook_handler(struct thread *td, int function, void *arg)
}
if (freepath)
- FREE(freepath, M_TEMP);
+ free(freepath, M_TEMP);
PMCDBG(PRC,EXC,1, "exec proc=%p (%d, %s) cred-changed=%d",
@@ -1765,7 +1765,7 @@ pmc_hook_handler(struct thread *td, int function, void *arg)
if (pp->pp_refcnt == 0) {
pmc_remove_process_descriptor(pp);
- FREE(pp, M_PMC);
+ free(pp, M_PMC);
break;
}
@@ -1861,7 +1861,7 @@ pmc_allocate_owner_descriptor(struct proc *p)
poh = &pmc_ownerhash[hindex];
/* allocate space for N pointers and one descriptor struct */
- MALLOC(po, struct pmc_owner *, sizeof(struct pmc_owner),
+ po = malloc(sizeof(struct pmc_owner),
M_PMC, M_ZERO|M_WAITOK);
po->po_sscount = po->po_error = po->po_flags = 0;
@@ -1888,7 +1888,7 @@ pmc_destroy_owner_descriptor(struct pmc_owner *po)
po, po->po_owner, po->po_owner->p_pid, po->po_owner->p_comm);
mtx_destroy(&po->po_mtx);
- FREE(po, M_PMC);
+ free(po, M_PMC);
}
/*
@@ -1915,8 +1915,7 @@ pmc_find_process_descriptor(struct proc *p, uint32_t mode)
if (mode & PMC_FLAG_ALLOCATE) {
/* allocate additional space for 'n' pmc pointers */
- MALLOC(ppnew, struct pmc_process *,
- sizeof(struct pmc_process) + md->pmd_npmc *
+ ppnew = malloc( sizeof(struct pmc_process) + md->pmd_npmc *
sizeof(struct pmc_targetstate), M_PMC, M_ZERO|M_WAITOK);
}
@@ -1938,7 +1937,7 @@ pmc_find_process_descriptor(struct proc *p, uint32_t mode)
mtx_unlock_spin(&pmc_processhash_mtx);
if (pp != NULL && ppnew != NULL)
- FREE(ppnew, M_PMC);
+ free(ppnew, M_PMC);
return pp;
}
@@ -1997,7 +1996,7 @@ pmc_allocate_pmc_descriptor(void)
{
struct pmc *pmc;
- MALLOC(pmc, struct pmc *, sizeof(struct pmc), M_PMC, M_ZERO|M_WAITOK);
+ pmc = malloc(sizeof(struct pmc), M_PMC, M_ZERO|M_WAITOK);
if (pmc != NULL) {
pmc->pm_owner = NULL;
@@ -2187,7 +2186,7 @@ pmc_release_pmc_descriptor(struct pmc *pm)
if (pp->pp_refcnt == 0) {
pmc_remove_process_descriptor(pp);
- FREE(pp, M_PMC);
+ free(pp, M_PMC);
}
}
@@ -2819,7 +2818,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_args)
npmc = md->pmd_npmc;
pmcinfo_size = npmc * sizeof(struct pmc_info);
- MALLOC(pmcinfo, struct pmc_info *, pmcinfo_size, M_PMC,
+ pmcinfo = malloc(pmcinfo_size, M_PMC,
M_WAITOK);
p = pmcinfo;
@@ -2863,7 +2862,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_args)
if (error == 0)
error = copyout(pmcinfo, &gpi->pm_pmcs, pmcinfo_size);
- FREE(pmcinfo, M_PMC);
+ free(pmcinfo, M_PMC);
}
break;
@@ -3127,7 +3126,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_args)
if (n == (int) md->pmd_npmc) {
pmc_destroy_pmc_descriptor(pmc);
- FREE(pmc, M_PMC);
+ free(pmc, M_PMC);
pmc = NULL;
error = EINVAL;
break;
@@ -3162,7 +3161,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_args)
(error = md->pmd_config_pmc(cpu, n, pmc)) != 0) {
(void) md->pmd_release_pmc(cpu, n, pmc);
pmc_destroy_pmc_descriptor(pmc);
- FREE(pmc, M_PMC);
+ free(pmc, M_PMC);
pmc = NULL;
pmc_restore_cpu_binding(&pb);
error = EPERM;
@@ -3190,7 +3189,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_args)
if ((error =
pmc_register_owner(curthread->td_proc, pmc)) != 0) {
pmc_release_pmc_descriptor(pmc);
- FREE(pmc, M_PMC);
+ free(pmc, M_PMC);
pmc = NULL;
break;
}
@@ -3432,7 +3431,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_args)
pmc_release_pmc_descriptor(pm);
pmc_maybe_remove_owner(po);
- FREE(pm, M_PMC);
+ free(pm, M_PMC);
}
break;
@@ -4167,7 +4166,7 @@ pmc_process_exit(void *arg __unused, struct proc *p)
pmclog_process_procexit(pm, pp);
pmc_unlink_target_process(pm, pp);
}
- FREE(pp, M_PMC);
+ free(pp, M_PMC);
} else
critical_exit(); /* pp == NULL */
@@ -4353,12 +4352,11 @@ pmc_initialize(void)
maxcpu = pmc_cpu_max();
/* allocate space for the per-cpu array */
- MALLOC(pmc_pcpu, struct pmc_cpu **, maxcpu * sizeof(struct pmc_cpu *),
+ pmc_pcpu = malloc(maxcpu * sizeof(struct pmc_cpu *),
M_PMC, M_WAITOK|M_ZERO);
/* per-cpu 'saved values' for managing process-mode PMCs */
- MALLOC(pmc_pcpu_saved, pmc_value_t *,
- sizeof(pmc_value_t) * maxcpu * md->pmd_npmc, M_PMC, M_WAITOK);
+ pmc_pcpu_saved = malloc( sizeof(pmc_value_t) * maxcpu * md->pmd_npmc, M_PMC, M_WAITOK);
/* Perform CPU-dependent initialization. */
pmc_save_cpu_binding(&pb);
@@ -4378,8 +4376,7 @@ pmc_initialize(void)
for (cpu = 0; cpu < maxcpu; cpu++) {
if (!pmc_cpu_is_active(cpu))
continue;
- MALLOC(sb, struct pmc_samplebuffer *,
- sizeof(struct pmc_samplebuffer) +
+ sb = malloc( sizeof(struct pmc_samplebuffer) +
pmc_nsamples * sizeof(struct pmc_sample), M_PMC,
M_WAITOK|M_ZERO);
@@ -4388,8 +4385,7 @@ pmc_initialize(void)
KASSERT(pmc_pcpu[cpu] != NULL,
("[pmc,%d] cpu=%d Null per-cpu data", __LINE__, cpu));
- MALLOC(sb->ps_callchains, uintptr_t *,
- pmc_callchaindepth * pmc_nsamples * sizeof(uintptr_t),
+ sb->ps_callchains = malloc( pmc_callchaindepth * pmc_nsamples * sizeof(uintptr_t),
M_PMC, M_WAITOK|M_ZERO);
for (n = 0, ps = sb->ps_samples; n < pmc_nsamples; n++, ps++)
@@ -4554,8 +4550,8 @@ pmc_cleanup(void)
KASSERT(pmc_pcpu[cpu]->pc_sb != NULL,
("[pmc,%d] Null cpu sample buffer cpu=%d", __LINE__,
cpu));
- FREE(pmc_pcpu[cpu]->pc_sb->ps_callchains, M_PMC);
- FREE(pmc_pcpu[cpu]->pc_sb, M_PMC);
+ free(pmc_pcpu[cpu]->pc_sb->ps_callchains, M_PMC);
+ free(pmc_pcpu[cpu]->pc_sb, M_PMC);
pmc_pcpu[cpu]->pc_sb = NULL;
}
@@ -4572,20 +4568,20 @@ pmc_cleanup(void)
if (md->pmd_cleanup)
md->pmd_cleanup(cpu);
}
- FREE(md, M_PMC);
+ free(md, M_PMC);
md = NULL;
pmc_restore_cpu_binding(&pb);
}
/* deallocate per-cpu structures */
- FREE(pmc_pcpu, M_PMC);
+ free(pmc_pcpu, M_PMC);
pmc_pcpu = NULL;
- FREE(pmc_pcpu_saved, M_PMC);
+ free(pmc_pcpu_saved, M_PMC);
pmc_pcpu_saved = NULL;
if (pmc_pmcdisp) {
- FREE(pmc_pmcdisp, M_PMC);
+ free(pmc_pmcdisp, M_PMC);
pmc_pmcdisp = NULL;
}
diff --git a/sys/dev/hwpmc/hwpmc_piv.c b/sys/dev/hwpmc/hwpmc_piv.c
index 5a22cc9fe64b..01de68ce53bd 100644
--- a/sys/dev/hwpmc/hwpmc_piv.c
+++ b/sys/dev/hwpmc/hwpmc_piv.c
@@ -628,8 +628,7 @@ p4_init(int cpu)
if (pcs == NULL) /* decline to init */
return ENXIO;
- MALLOC(plcs, struct p4_logicalcpu *,
- sizeof(struct p4_logicalcpu), M_PMC, M_WAITOK|M_ZERO);
+ plcs = malloc( sizeof(struct p4_logicalcpu), M_PMC, M_WAITOK|M_ZERO);
/* The TSC is architectural state and is not shared */
plcs->pc_hwpmcs[0] = &plcs->pc_tsc;
@@ -645,7 +644,7 @@ p4_init(int cpu)
return 0;
}
- MALLOC(pcs, struct p4_cpu *, sizeof(struct p4_cpu), M_PMC,
+ pcs = malloc(sizeof(struct p4_cpu), M_PMC,
M_WAITOK|M_ZERO);
if (pcs == NULL)
@@ -699,7 +698,7 @@ p4_cleanup(int cpu)
if (!P4_CPU_IS_HTT_SECONDARY(cpu))
mtx_destroy(&pcs->pc_mtx);
- FREE(pcs, M_PMC);
+ free(pcs, M_PMC);
pmc_pcpu[cpu] = NULL;
@@ -1081,7 +1080,7 @@ p4_allocate_pmc(int cpu, int ri, struct pmc *pm,
/*
* If the system has HTT enabled, and the desired allocation
* mode is process-private, and the PMC row disposition is not
- * FREE (0), decline the allocation.
+ * free (0), decline the allocation.
*/
if (p4_system_has_htt &&
diff --git a/sys/dev/hwpmc/hwpmc_ppro.c b/sys/dev/hwpmc/hwpmc_ppro.c
index 9289e90f2297..fc40e19d92a9 100644
--- a/sys/dev/hwpmc/hwpmc_ppro.c
+++ b/sys/dev/hwpmc/hwpmc_ppro.c
@@ -349,7 +349,7 @@ p6_init(int cpu)
PMCDBG(MDP,INI,0,"p6-init cpu=%d", cpu);
- MALLOC(pcs, struct p6_cpu *, sizeof(struct p6_cpu), M_PMC,
+ pcs = malloc(sizeof(struct p6_cpu), M_PMC,
M_WAITOK|M_ZERO);
phw = pcs->pc_p6pmcs;
@@ -380,7 +380,7 @@ p6_cleanup(int cpu)
PMCDBG(MDP,INI,0,"p6-cleanup cpu=%d", cpu);
if ((pcs = pmc_pcpu[cpu]) != NULL)
- FREE(pcs, M_PMC);
+ free(pcs, M_PMC);
pmc_pcpu[cpu] = NULL;
return 0;
diff --git a/sys/dev/hwpmc/hwpmc_x86.c b/sys/dev/hwpmc/hwpmc_x86.c
index 8720c0e8864b..66bf8dd4cc65 100644
--- a/sys/dev/hwpmc/hwpmc_x86.c
+++ b/sys/dev/hwpmc/hwpmc_x86.c
@@ -293,7 +293,7 @@ pmc_intel_initialize(void)
return NULL;
}
- MALLOC(pmc_mdep, struct pmc_mdep *, sizeof(struct pmc_mdep),
+ pmc_mdep = malloc(sizeof(struct pmc_mdep),
M_PMC, M_WAITOK|M_ZERO);
pmc_mdep->pmd_cputype = cputype;
@@ -346,7 +346,7 @@ pmc_intel_initialize(void)
}
if (error) {
- FREE(pmc_mdep, M_PMC);
+ free(pmc_mdep, M_PMC);
pmc_mdep = NULL;
}
diff --git a/sys/dev/lmc/if_lmc.c b/sys/dev/lmc/if_lmc.c
index 8017e018032c..a5a722be7c79 100644
--- a/sys/dev/lmc/if_lmc.c
+++ b/sys/dev/lmc/if_lmc.c
@@ -5070,8 +5070,8 @@ ng_rcvmsg(node_p node, struct ng_mesg *msg,
if (rptr != NULL)
*rptr = resp;
else if (resp != NULL)
- FREE(resp, M_NETGRAPH);
- FREE(msg, M_NETGRAPH);
+ free(resp, M_NETGRAPH);
+ free(msg, M_NETGRAPH);
# endif
return error;
diff --git a/sys/dev/ray/if_ray.c b/sys/dev/ray/if_ray.c
index 0742c7c9e976..513312c82134 100644
--- a/sys/dev/ray/if_ray.c
+++ b/sys/dev/ray/if_ray.c
@@ -3177,8 +3177,7 @@ ray_com_malloc(ray_comqfn_t function, int flags, char *mesg)
{
struct ray_comq_entry *com;
- MALLOC(com, struct ray_comq_entry *,
- sizeof(struct ray_comq_entry), M_RAYCOM, M_WAITOK);
+ com = malloc( sizeof(struct ray_comq_entry), M_RAYCOM, M_WAITOK);
return (ray_com_init(com, function, flags, mesg));
}
diff --git a/sys/dev/ray/if_rayvar.h b/sys/dev/ray/if_rayvar.h
index 7376405bb19a..d3498a4dd11e 100644
--- a/sys/dev/ray/if_rayvar.h
+++ b/sys/dev/ray/if_rayvar.h
@@ -249,7 +249,7 @@ static int mib_info[RAY_MIB_MAX+1][3] = RAY_MIB_INFO;
#define RAY_COM_FREE(com, ncom) do { \
int i; \
for (i = 0; i < ncom; i++) \
- FREE(com[i], M_RAYCOM); \
+ free(com[i], M_RAYCOM); \
} while (0)
/*
diff --git a/sys/dev/sr/if_sr.c b/sys/dev/sr/if_sr.c
index 2711dfeaaa35..550771527acc 100644
--- a/sys/dev/sr/if_sr.c
+++ b/sys/dev/sr/if_sr.c
@@ -305,8 +305,7 @@ sr_attach(device_t device)
int unit; /* index: channel w/in card */
hc = (struct sr_hardc *)device_get_softc(device);
- MALLOC(sc, struct sr_softc *,
- hc->numports * sizeof(struct sr_softc),
+ sc = malloc( hc->numports * sizeof(struct sr_softc),
M_DEVBUF, M_WAITOK | M_ZERO);
if (sc == NULL)
goto errexit;
@@ -478,7 +477,7 @@ sr_detach(device_t device)
* deallocate any system resources we may have
* allocated on behalf of this driver.
*/
- FREE(hc->sc, M_DEVBUF);
+ free(hc->sc, M_DEVBUF);
hc->sc = NULL;
hc->mem_start = NULL;
return (sr_deallocate_resources(device));
diff --git a/sys/dev/usb/udbp.c b/sys/dev/usb/udbp.c
index 2ca437541aec..523184fd6964 100644
--- a/sys/dev/usb/udbp.c
+++ b/sys/dev/usb/udbp.c
@@ -411,10 +411,10 @@ udbp_attach(device_t self)
bad:
#if 0 /* probably done in udbp_detach() */
if (sc->sc_bulkout_buffer) {
- FREE(sc->sc_bulkout_buffer, M_USBDEV);
+ free(sc->sc_bulkout_buffer, M_USBDEV);
}
if (sc->sc_bulkin_buffer) {
- FREE(sc->sc_bulkin_buffer, M_USBDEV);
+ free(sc->sc_bulkin_buffer, M_USBDEV);
}
if (sc->sc_bulkout_xfer) {
usbd_free_xfer(sc->sc_bulkout_xfer);
diff --git a/sys/fs/cd9660/cd9660_node.c b/sys/fs/cd9660/cd9660_node.c
index bc852aeca245..d8db8b53115b 100644
--- a/sys/fs/cd9660/cd9660_node.c
+++ b/sys/fs/cd9660/cd9660_node.c
@@ -111,7 +111,7 @@ cd9660_reclaim(ap)
*/
if (ip->i_mnt->im_devvp)
vrele(ip->i_mnt->im_devvp);
- FREE(vp->v_data, M_ISOFSNODE);
+ free(vp->v_data, M_ISOFSNODE);
vp->v_data = NULL;
return (0);
}
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c
index f4ff62dc8d5d..7a8953d93701 100644
--- a/sys/fs/cd9660/cd9660_vfsops.c
+++ b/sys/fs/cd9660/cd9660_vfsops.c
@@ -676,7 +676,7 @@ cd9660_vget_internal(mp, ino, flags, vpp, relocated, isodir)
*vpp = NULLVP;
return (error);
}
- MALLOC(ip, struct iso_node *, sizeof(struct iso_node), M_ISOFSNODE,
+ ip = malloc(sizeof(struct iso_node), M_ISOFSNODE,
M_WAITOK | M_ZERO);
vp->v_data = ip;
ip->i_vnode = vp;
diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c
index 5f4bfe87b8e4..76fb233cf917 100644
--- a/sys/fs/cd9660/cd9660_vnops.c
+++ b/sys/fs/cd9660/cd9660_vnops.c
@@ -207,7 +207,7 @@ cd9660_getattr(ap)
struct uio auio;
char *cp;
- MALLOC(cp, char *, MAXPATHLEN, M_TEMP, M_WAITOK);
+ cp = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
aiov.iov_base = cp;
aiov.iov_len = MAXPATHLEN;
auio.uio_iov = &aiov;
@@ -222,7 +222,7 @@ cd9660_getattr(ap)
rdlnk.a_cred = ap->a_cred;
if (cd9660_readlink(&rdlnk) == 0)
vap->va_size = MAXPATHLEN - auio.uio_resid;
- FREE(cp, M_TEMP);
+ free(cp, M_TEMP);
}
vap->va_flags = 0;
vap->va_gen = 1;
@@ -470,7 +470,7 @@ cd9660_readdir(ap)
imp = dp->i_mnt;
bmask = imp->im_bmask;
- MALLOC(idp, struct isoreaddir *, sizeof(*idp), M_TEMP, M_WAITOK);
+ idp = malloc(sizeof(*idp), M_TEMP, M_WAITOK);
idp->saveent.d_namlen = idp->assocent.d_namlen = 0;
/*
* XXX
@@ -486,7 +486,7 @@ cd9660_readdir(ap)
* Guess the number of cookies needed.
*/
ncookies = uio->uio_resid / 16;
- MALLOC(cookies, u_long *, ncookies * sizeof(u_long),
+ cookies = malloc(ncookies * sizeof(u_long),
M_TEMP, M_WAITOK);
idp->cookies = cookies;
idp->ncookies = ncookies;
@@ -497,7 +497,7 @@ cd9660_readdir(ap)
if ((entryoffsetinblock = idp->curroff & bmask) &&
(error = cd9660_blkatoff(vdp, (off_t)idp->curroff, NULL, &bp))) {
- FREE(idp, M_TEMP);
+ free(idp, M_TEMP);
return (error);
}
endsearch = dp->i_size;
@@ -620,7 +620,7 @@ cd9660_readdir(ap)
uio->uio_offset = idp->uio_off;
*ap->a_eofflag = idp->eofflag;
- FREE(idp, M_TEMP);
+ free(idp, M_TEMP);
return (error);
}
diff --git a/sys/fs/fdescfs/fdesc_vfsops.c b/sys/fs/fdescfs/fdesc_vfsops.c
index 1994c1334a5a..96513130ce20 100644
--- a/sys/fs/fdescfs/fdesc_vfsops.c
+++ b/sys/fs/fdescfs/fdesc_vfsops.c
@@ -85,7 +85,7 @@ fdesc_mount(struct mount *mp, struct thread *td)
if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS))
return (EOPNOTSUPP);
- MALLOC(fmp, struct fdescmount *, sizeof(struct fdescmount),
+ fmp = malloc(sizeof(struct fdescmount),
M_FDESCMNT, M_WAITOK); /* XXX */
/*
diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c
index 289f29d325c2..d1788ae43490 100644
--- a/sys/fs/fdescfs/fdesc_vnops.c
+++ b/sys/fs/fdescfs/fdesc_vnops.c
@@ -186,11 +186,11 @@ loop:
}
mtx_unlock(&fdesc_hashmtx);
- MALLOC(fd, struct fdescnode *, sizeof(struct fdescnode), M_TEMP, M_WAITOK);
+ fd = malloc(sizeof(struct fdescnode), M_TEMP, M_WAITOK);
error = getnewvnode("fdescfs", mp, &fdesc_vnodeops, &vp);
if (error) {
- FREE(fd, M_TEMP);
+ free(fd, M_TEMP);
return (error);
}
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
@@ -616,7 +616,7 @@ fdesc_reclaim(ap)
vp = ap->a_vp;
fd = VTOFDESC(vp);
fdesc_remove_entry(fd);
- FREE(vp->v_data, M_TEMP);
+ free(vp->v_data, M_TEMP);
vp->v_data = NULL;
return (0);
}
diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c
index 051b59bc93d5..a875c058ce3e 100644
--- a/sys/fs/fifofs/fifo_vnops.c
+++ b/sys/fs/fifofs/fifo_vnops.c
@@ -154,7 +154,7 @@ fifo_cleanup(struct vnode *vp)
vp->v_fifoinfo = NULL;
(void)soclose(fip->fi_readsock);
(void)soclose(fip->fi_writesock);
- FREE(fip, M_VNODE);
+ free(fip, M_VNODE);
}
}
@@ -185,7 +185,7 @@ fifo_open(ap)
if (fp == NULL)
return (EINVAL);
if ((fip = vp->v_fifoinfo) == NULL) {
- MALLOC(fip, struct fifoinfo *, sizeof(*fip), M_VNODE, M_WAITOK);
+ fip = malloc(sizeof(*fip), M_VNODE, M_WAITOK);
error = socreate(AF_LOCAL, &rso, SOCK_STREAM, 0, cred, td);
if (error)
goto fail1;
diff --git a/sys/fs/hpfs/hpfs_subr.c b/sys/fs/hpfs/hpfs_subr.c
index 6844545ae239..ae9a70d933f7 100644
--- a/sys/fs/hpfs/hpfs_subr.c
+++ b/sys/fs/hpfs/hpfs_subr.c
@@ -85,8 +85,8 @@ hpfs_bmdeinit(
}
}
- FREE(hpmp->hpm_bitmap,M_HPFSMNT);
- FREE(hpmp->hpm_bmind,M_HPFSMNT);
+ free(hpmp->hpm_bitmap,M_HPFSMNT);
+ free(hpmp->hpm_bmind,M_HPFSMNT);
dprintf(("\n"));
}
@@ -109,18 +109,18 @@ hpfs_bminit(
dprintf(("0x%lx data bands, ", hpmp->hpm_dbnum));
- MALLOC(hpmp->hpm_bmind, lsn_t *, hpmp->hpm_dbnum * sizeof(lsn_t),
+ hpmp->hpm_bmind = malloc(hpmp->hpm_dbnum * sizeof(lsn_t),
M_HPFSMNT, M_WAITOK);
- MALLOC(hpmp->hpm_bitmap, u_int8_t *, hpmp->hpm_dbnum * BMSIZE,
+ hpmp->hpm_bitmap = malloc(hpmp->hpm_dbnum * BMSIZE,
M_HPFSMNT, M_WAITOK);
error = bread(hpmp->hpm_devvp, hpmp->hpm_su.su_bitmap.lsn1,
((hpmp->hpm_dbnum + 0x7F) & ~(0x7F)) << 2, NOCRED, &bp);
if (error) {
brelse(bp);
- FREE(hpmp->hpm_bitmap, M_HPFSMNT);
- FREE(hpmp->hpm_bmind, M_HPFSMNT);
+ free(hpmp->hpm_bitmap, M_HPFSMNT);
+ free(hpmp->hpm_bmind, M_HPFSMNT);
dprintf((" error %d\n", error));
return (error);
}
@@ -138,8 +138,8 @@ hpfs_bminit(
BMSIZE, NOCRED, &bp);
if (error) {
brelse(bp);
- FREE(hpmp->hpm_bitmap, M_HPFSMNT);
- FREE(hpmp->hpm_bmind, M_HPFSMNT);
+ free(hpmp->hpm_bitmap, M_HPFSMNT);
+ free(hpmp->hpm_bmind, M_HPFSMNT);
dprintf((" error %d\n", error));
return (error);
}
@@ -278,8 +278,7 @@ hpfs_cpinit (
cpicnt = hpmp->hpm_sp.sp_cpinum;
- MALLOC(hpmp->hpm_cpdblk, struct cpdblk *,
- cpicnt * sizeof(struct cpdblk), M_HPFSMNT, M_WAITOK);
+ hpmp->hpm_cpdblk = malloc( cpicnt * sizeof(struct cpdblk), M_HPFSMNT, M_WAITOK);
cpdbp = hpmp->hpm_cpdblk;
lsn = hpmp->hpm_sp.sp_cpi;
@@ -317,7 +316,7 @@ hpfs_cpdeinit (
struct hpfsmount *hpmp)
{
dprintf(("hpmp_cpdeinit: "));
- FREE(hpmp->hpm_cpdblk,M_HPFSMNT);
+ free(hpmp->hpm_cpdblk,M_HPFSMNT);
return (0);
}
diff --git a/sys/fs/hpfs/hpfs_vfsops.c b/sys/fs/hpfs/hpfs_vfsops.c
index 02b5ea40601e..36d3dd5321ba 100644
--- a/sys/fs/hpfs/hpfs_vfsops.c
+++ b/sys/fs/hpfs/hpfs_vfsops.c
@@ -371,7 +371,7 @@ hpfs_unmount(
MNT_ILOCK(mp);
mp->mnt_flag &= ~MNT_LOCAL;
MNT_IUNLOCK(mp);
- FREE(hpmp, M_HPFSMNT);
+ free(hpmp, M_HPFSMNT);
return (0);
}
@@ -476,13 +476,13 @@ hpfs_vget(
* at that time is little, and anyway - we'll
* check for it).
*/
- MALLOC(hp, struct hpfsnode *, sizeof(struct hpfsnode),
+ hp = malloc(sizeof(struct hpfsnode),
M_HPFSNO, M_WAITOK);
error = getnewvnode("hpfs", mp, &hpfs_vnodeops, &vp);
if (error) {
printf("hpfs_vget: can't get new vnode\n");
- FREE(hp, M_HPFSNO);
+ free(hp, M_HPFSNO);
return (error);
}
diff --git a/sys/fs/hpfs/hpfs_vnops.c b/sys/fs/hpfs/hpfs_vnops.c
index ed343e0a1f14..af7cd52c4d77 100644
--- a/sys/fs/hpfs/hpfs_vnops.c
+++ b/sys/fs/hpfs/hpfs_vnops.c
@@ -611,7 +611,7 @@ hpfs_reclaim(ap)
vp->v_data = NULL;
- FREE(hp, M_HPFSNO);
+ free(hp, M_HPFSNO);
return (0);
}
@@ -1003,7 +1003,7 @@ readdone:
dpStart = (struct dirent *)
((caddr_t)uio->uio_iov->iov_base -
(uio->uio_offset - off));
- MALLOC(cookies, u_long *, ncookies * sizeof(u_long),
+ cookies = malloc(ncookies * sizeof(u_long),
M_TEMP, M_WAITOK);
for (dp = dpStart, cookiep = cookies, i=0;
i < ncookies;
diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c
index 8fd61cdb8f38..d4614847d143 100644
--- a/sys/fs/msdosfs/msdosfs_denode.c
+++ b/sys/fs/msdosfs/msdosfs_denode.c
@@ -148,7 +148,7 @@ deget(pmp, dirclust, diroffset, depp)
* might cause a bogus v_data pointer to get dereferenced
* elsewhere if MALLOC should block.
*/
- MALLOC(ldep, struct denode *, sizeof(struct denode), M_MSDOSFSNODE, M_WAITOK);
+ ldep = malloc(sizeof(struct denode), M_MSDOSFSNODE, M_WAITOK);
/*
* Directory entry was not in cache, have to create a vnode and
@@ -158,7 +158,7 @@ deget(pmp, dirclust, diroffset, depp)
error = getnewvnode("msdosfs", mntp, &msdosfs_vnodeops, &nvp);
if (error) {
*depp = NULL;
- FREE(ldep, M_MSDOSFSNODE);
+ free(ldep, M_MSDOSFSNODE);
return error;
}
bzero((caddr_t)ldep, sizeof *ldep);
@@ -173,7 +173,7 @@ deget(pmp, dirclust, diroffset, depp)
lockmgr(nvp->v_vnlock, LK_EXCLUSIVE, NULL);
error = insmntque(nvp, mntp);
if (error != 0) {
- FREE(ldep, M_MSDOSFSNODE);
+ free(ldep, M_MSDOSFSNODE);
*depp = NULL;
return (error);
}
@@ -567,7 +567,7 @@ msdosfs_reclaim(ap)
#if 0 /* XXX */
dep->de_flag = 0;
#endif
- FREE(dep, M_MSDOSFSNODE);
+ free(dep, M_MSDOSFSNODE);
vp->v_data = NULL;
return (0);
diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c
index e16da65758da..877e4920905f 100644
--- a/sys/fs/msdosfs/msdosfs_vnops.c
+++ b/sys/fs/msdosfs/msdosfs_vnops.c
@@ -1561,7 +1561,7 @@ msdosfs_readdir(ap)
if (ap->a_ncookies) {
ncookies = uio->uio_resid / 16;
- MALLOC(cookies, u_long *, ncookies * sizeof(u_long), M_TEMP,
+ cookies = malloc(ncookies * sizeof(u_long), M_TEMP,
M_WAITOK);
*ap->a_cookies = cookies;
*ap->a_ncookies = ncookies;
diff --git a/sys/fs/ntfs/ntfs_subr.c b/sys/fs/ntfs/ntfs_subr.c
index f06ddeb64f1e..e50cdf2da8f5 100644
--- a/sys/fs/ntfs/ntfs_subr.c
+++ b/sys/fs/ntfs/ntfs_subr.c
@@ -190,7 +190,7 @@ ntfs_ntvattrget(
}
/* Scan $ATTRIBUTE_LIST for requested attribute */
len = lvap->va_datalen;
- MALLOC(alpool, caddr_t, len, M_TEMP, M_WAITOK);
+ alpool = malloc(len, M_TEMP, M_WAITOK);
error = ntfs_readntvattr_plain(ntmp, ip, lvap, 0, len, alpool, &len,
NULL);
if (error)
@@ -246,7 +246,7 @@ ntfs_ntvattrget(
"ino: %d, type: 0x%x, name: %.*s, vcn: %d\n", \
ip->i_number, type, (int) namelen, name, (u_int32_t) vcn));
out:
- FREE(alpool, M_TEMP);
+ free(alpool, M_TEMP);
return (error);
}
@@ -268,7 +268,7 @@ ntfs_loadntnode(
dprintf(("ntfs_loadntnode: loading ino: %d\n",ip->i_number));
- MALLOC(mfrp, struct filerec *, ntfs_bntob(ntmp->ntm_bpmftrec),
+ mfrp = malloc(ntfs_bntob(ntmp->ntm_bpmftrec),
M_TEMP, M_WAITOK);
if (ip->i_number < NTFS_SYSNODESNUM) {
@@ -341,7 +341,7 @@ ntfs_loadntnode(
ip->i_flag |= IN_LOADED;
out:
- FREE(mfrp, M_TEMP);
+ free(mfrp, M_TEMP);
return (error);
}
@@ -391,7 +391,7 @@ ntfs_ntlookup(
}
} while (lockmgr(&ntfs_hashlock, LK_EXCLUSIVE | LK_SLEEPFAIL, NULL));
- MALLOC(ip, struct ntnode *, sizeof(struct ntnode), M_NTFSNTNODE,
+ ip = malloc(sizeof(struct ntnode), M_NTFSNTNODE,
M_WAITOK | M_ZERO);
ddprintf(("ntfs_ntlookup: allocating ntnode: %d: %p\n", ino, ip));
@@ -466,7 +466,7 @@ ntfs_ntput(ip)
mtx_destroy(&ip->i_interlock);
lockdestroy(&ip->i_lock);
vrele(ip->i_devvp);
- FREE(ip, M_NTFSNTNODE);
+ free(ip, M_NTFSNTNODE);
}
/*
@@ -513,14 +513,14 @@ ntfs_freentvattr(vap)
{
if (vap->va_flag & NTFS_AF_INRUN) {
if (vap->va_vruncn)
- FREE(vap->va_vruncn, M_NTFSRUN);
+ free(vap->va_vruncn, M_NTFSRUN);
if (vap->va_vruncl)
- FREE(vap->va_vruncl, M_NTFSRUN);
+ free(vap->va_vruncl, M_NTFSRUN);
} else {
if (vap->va_datap)
- FREE(vap->va_datap, M_NTFSRDATA);
+ free(vap->va_datap, M_NTFSRDATA);
}
- FREE(vap, M_NTFSNTVATTR);
+ free(vap, M_NTFSNTVATTR);
}
/*
@@ -539,7 +539,7 @@ ntfs_attrtontvattr(
error = 0;
*rvapp = NULL;
- MALLOC(vap, struct ntvattr *, sizeof(struct ntvattr),
+ vap = malloc(sizeof(struct ntvattr),
M_NTFSNTVATTR, M_WAITOK | M_ZERO);
vap->va_ip = NULL;
vap->va_flag = rap->a_hdr.a_flag;
@@ -576,7 +576,7 @@ ntfs_attrtontvattr(
vap->va_allocated = rap->a_r.a_datalen;
vap->va_vcnstart = 0;
vap->va_vcnend = ntfs_btocn(vap->va_allocated);
- MALLOC(vap->va_datap, caddr_t, vap->va_datalen,
+ vap->va_datap = malloc(vap->va_datalen,
M_NTFSRDATA, M_WAITOK);
memcpy(vap->va_datap, (caddr_t) rap + rap->a_r.a_dataoff,
rap->a_r.a_datalen);
@@ -584,7 +584,7 @@ ntfs_attrtontvattr(
ddprintf((", len: %d", vap->va_datalen));
if (error)
- FREE(vap, M_NTFSNTVATTR);
+ free(vap, M_NTFSNTVATTR);
else
*rvapp = vap;
@@ -618,8 +618,8 @@ ntfs_runtovrun(
off += (run[off] & 0xF) + ((run[off] >> 4) & 0xF) + 1;
cnt++;
}
- MALLOC(cn, cn_t *, cnt * sizeof(cn_t), M_NTFSRUN, M_WAITOK);
- MALLOC(cl, cn_t *, cnt * sizeof(cn_t), M_NTFSRUN, M_WAITOK);
+ cn = malloc(cnt * sizeof(cn_t), M_NTFSRUN, M_WAITOK);
+ cl = malloc(cnt * sizeof(cn_t), M_NTFSRUN, M_WAITOK);
off = 0;
cnt = 0;
@@ -769,14 +769,14 @@ ntfs_fget(
if (*fpp)
return (0);
- MALLOC(fp, struct fnode *, sizeof(struct fnode), M_NTFSFNODE,
+ fp = malloc(sizeof(struct fnode), M_NTFSFNODE,
M_WAITOK | M_ZERO);
dprintf(("ntfs_fget: allocating fnode: %p\n",fp));
fp->f_ip = ip;
if (attrname) {
fp->f_flag |= FN_AATTRNAME;
- MALLOC(fp->f_attrname, char *, strlen(attrname)+1, M_TEMP, M_WAITOK);
+ fp->f_attrname = malloc(strlen(attrname)+1, M_TEMP, M_WAITOK);
strcpy(fp->f_attrname, attrname);
} else
fp->f_attrname = NULL;
@@ -807,10 +807,10 @@ ntfs_frele(
dprintf(("ntfs_frele: deallocating fnode\n"));
LIST_REMOVE(fp,f_fnlist);
if (fp->f_flag & FN_AATTRNAME)
- FREE(fp->f_attrname, M_TEMP);
+ free(fp->f_attrname, M_TEMP);
if (fp->f_dirblbuf)
- FREE(fp->f_dirblbuf, M_NTFSDIR);
- FREE(fp, M_NTFSFNODE);
+ free(fp->f_dirblbuf, M_NTFSDIR);
+ free(fp, M_NTFSFNODE);
ntfs_ntrele(ip);
}
@@ -861,7 +861,7 @@ ntfs_ntlookupattr(
out:
if (namelen) {
- MALLOC((*attrname), char *, namelen, M_TEMP, M_WAITOK);
+ (*attrname) = malloc(namelen, M_TEMP, M_WAITOK);
memcpy((*attrname), name, namelen);
(*attrname)[namelen] = '\0';
}
@@ -926,7 +926,7 @@ ntfs_ntlookupfile(
dprintf(("ntfs_ntlookupfile: blksz: %d, rdsz: %jd\n", blsize, rdsize));
- MALLOC(rdbuf, caddr_t, blsize, M_TEMP, M_WAITOK);
+ rdbuf = malloc(blsize, M_TEMP, M_WAITOK);
error = ntfs_readattr(ntmp, ip, NTFS_A_INDXROOT, "$I30",
0, rdsize, rdbuf, NULL);
@@ -991,7 +991,7 @@ ntfs_ntlookupfile(
/* free the buffer returned by ntfs_ntlookupattr() */
if (attrname) {
- FREE(attrname, M_TEMP);
+ free(attrname, M_TEMP);
attrname = NULL;
}
@@ -1069,10 +1069,10 @@ ntfs_ntlookupfile(
dprintf(("finish\n"));
fail:
- if (attrname) FREE(attrname, M_TEMP);
+ if (attrname) free(attrname, M_TEMP);
ntfs_ntvattrrele(vap);
ntfs_ntput(ip);
- FREE(rdbuf, M_TEMP);
+ free(rdbuf, M_TEMP);
return (error);
}
@@ -1143,8 +1143,7 @@ ntfs_ntreaddir(
if (fp->f_dirblbuf == NULL) {
fp->f_dirblsz = vap->va_a_iroot->ir_size;
- MALLOC(fp->f_dirblbuf, caddr_t,
- max(vap->va_datalen,fp->f_dirblsz), M_NTFSDIR, M_WAITOK);
+ fp->f_dirblbuf = malloc( max(vap->va_datalen,fp->f_dirblsz), M_NTFSDIR, M_WAITOK);
}
blsize = fp->f_dirblsz;
@@ -1159,7 +1158,7 @@ ntfs_ntreaddir(
error = ENOTDIR;
goto fail;
}
- MALLOC(bmp, u_int8_t *, bmvap->va_datalen, M_TEMP, M_WAITOK);
+ bmp = malloc(bmvap->va_datalen, M_TEMP, M_WAITOK);
error = ntfs_readattr(ntmp, ip, NTFS_A_INDXBITMAP, "$I30", 0,
bmvap->va_datalen, bmp, NULL);
if (error)
@@ -1265,7 +1264,7 @@ fail:
if (iavap)
ntfs_ntvattrrele(iavap);
if (bmp)
- FREE(bmp, M_TEMP);
+ free(bmp, M_TEMP);
ntfs_ntput(ip);
return (error);
}
@@ -1756,9 +1755,9 @@ ntfs_readattr(
ddprintf(("ntfs_ntreadattr: compression: %d\n",
vap->va_compressalg));
- MALLOC(cup, u_int8_t *, ntfs_cntob(NTFS_COMPUNIT_CL),
+ cup = malloc(ntfs_cntob(NTFS_COMPUNIT_CL),
M_NTFSDECOMP, M_WAITOK);
- MALLOC(uup, u_int8_t *, ntfs_cntob(NTFS_COMPUNIT_CL),
+ uup = malloc(ntfs_cntob(NTFS_COMPUNIT_CL),
M_NTFSDECOMP, M_WAITOK);
cn = (ntfs_btocn(roff)) & (~(NTFS_COMPUNIT_CL - 1));
@@ -1803,8 +1802,8 @@ ntfs_readattr(
cn += NTFS_COMPUNIT_CL;
}
- FREE(uup, M_NTFSDECOMP);
- FREE(cup, M_NTFSDECOMP);
+ free(uup, M_NTFSDECOMP);
+ free(cup, M_NTFSDECOMP);
} else
error = ntfs_readattr_plain(ntmp, ip, attrnum, attrname,
roff, rsize, rdata, &init, uio);
@@ -1991,7 +1990,7 @@ ntfs_toupper_use(mp, ntmp)
* XXX for now, just the first 256 entries are used anyway,
* so don't bother reading more
*/
- MALLOC(ntfs_toupper_tab, wchar *, 65536 * sizeof(wchar),
+ ntfs_toupper_tab = malloc(65536 * sizeof(wchar),
M_NTFSRDATA, M_WAITOK);
if ((error = VFS_VGET(mp, NTFS_UPCASEINO, LK_EXCLUSIVE, &vp)))
@@ -2018,7 +2017,7 @@ ntfs_toupper_unuse()
ntfs_toupper_usecount--;
if (ntfs_toupper_usecount == 0) {
- FREE(ntfs_toupper_tab, M_NTFSRDATA);
+ free(ntfs_toupper_tab, M_NTFSRDATA);
ntfs_toupper_tab = NULL;
}
#ifdef DIAGNOSTIC
@@ -2047,14 +2046,14 @@ ntfs_u28_init(
return (0);
}
- MALLOC(u28, char **, 256 * sizeof(char*), M_TEMP, M_WAITOK | M_ZERO);
+ u28 = malloc(256 * sizeof(char*), M_TEMP, M_WAITOK | M_ZERO);
for (i=0; i<256; i++) {
h = (u2w[i] >> 8) & 0xFF;
l = (u2w[i]) &0xFF;
if (u28[h] == NULL) {
- MALLOC(u28[h], char *, 256 * sizeof(char), M_TEMP, M_WAITOK);
+ u28[h] = malloc(256 * sizeof(char), M_TEMP, M_WAITOK);
for (j=0; j<256; j++)
u28[h][j] = '_';
}
@@ -2084,9 +2083,9 @@ ntfs_u28_uninit(struct ntfsmount *ntmp)
for (i=0; i<256; i++)
if (u28[i] != NULL)
- FREE(u28[i], M_TEMP);
+ free(u28[i], M_TEMP);
- FREE(u28, M_TEMP);
+ free(u28, M_TEMP);
return (0);
}
@@ -2105,7 +2104,7 @@ ntfs_82u_init(
return (0);
}
- MALLOC(_82u, wchar *, 256 * sizeof(wchar), M_TEMP, M_WAITOK);
+ _82u = malloc(256 * sizeof(wchar), M_TEMP, M_WAITOK);
for (i=0; i<256; i++)
_82u[i] = i;
@@ -2126,7 +2125,7 @@ ntfs_82u_uninit(struct ntfsmount *ntmp)
return (0);
}
- FREE(ntmp->ntm_82u, M_TEMP);
+ free(ntmp->ntm_82u, M_TEMP);
return (0);
}
diff --git a/sys/fs/ntfs/ntfs_vfsops.c b/sys/fs/ntfs/ntfs_vfsops.c
index 86ff17ad1209..6baaca1b5926 100644
--- a/sys/fs/ntfs/ntfs_vfsops.c
+++ b/sys/fs/ntfs/ntfs_vfsops.c
@@ -416,8 +416,7 @@ ntfs_mountfs(devvp, mp, td)
}
/* Alloc memory for attribute definitions */
- MALLOC(ntmp->ntm_ad, struct ntvattrdef *,
- num * sizeof(struct ntvattrdef),
+ ntmp->ntm_ad = malloc( num * sizeof(struct ntvattrdef),
M_NTFSMNT, M_WAITOK);
ntmp->ntm_adnum = num;
@@ -526,8 +525,8 @@ ntfs_unmount(
MNT_ILOCK(mp);
mp->mnt_flag &= ~MNT_LOCAL;
MNT_IUNLOCK(mp);
- FREE(ntmp->ntm_ad, M_NTFSMNT);
- FREE(ntmp, M_NTFSMNT);
+ free(ntmp->ntm_ad, M_NTFSMNT);
+ free(ntmp, M_NTFSMNT);
return (error);
}
@@ -568,7 +567,7 @@ ntfs_calccfree(
bmsize = VTOF(vp)->f_size;
- MALLOC(tmp, u_int8_t *, bmsize, M_TEMP, M_WAITOK);
+ tmp = malloc(bmsize, M_TEMP, M_WAITOK);
error = ntfs_readattr(ntmp, VTONT(vp), NTFS_A_DATA, NULL,
0, bmsize, tmp, NULL);
@@ -581,7 +580,7 @@ ntfs_calccfree(
*cfreep = cfree;
out:
- FREE(tmp, M_TEMP);
+ free(tmp, M_TEMP);
return(error);
}
diff --git a/sys/fs/ntfs/ntfs_vnops.c b/sys/fs/ntfs/ntfs_vnops.c
index 7bf8b28e7e65..991504ccb9d7 100644
--- a/sys/fs/ntfs/ntfs_vnops.c
+++ b/sys/fs/ntfs/ntfs_vnops.c
@@ -595,7 +595,7 @@ ntfs_readdir(ap)
dpStart = (struct dirent *)
((caddr_t)uio->uio_iov->iov_base -
(uio->uio_offset - off));
- MALLOC(cookies, u_long *, ncookies * sizeof(u_long),
+ cookies = malloc(ncookies * sizeof(u_long),
M_TEMP, M_WAITOK);
for (dp = dpStart, cookiep = cookies, i=0;
i < ncookies;
diff --git a/sys/fs/nullfs/null_subr.c b/sys/fs/nullfs/null_subr.c
index 44de4189d901..dd60ce8389e9 100644
--- a/sys/fs/nullfs/null_subr.c
+++ b/sys/fs/nullfs/null_subr.c
@@ -173,7 +173,7 @@ null_insmntque_dtr(struct vnode *vp, void *xp)
{
vp->v_data = NULL;
vp->v_vnlock = &vp->v_lock;
- FREE(xp, M_NULLFSNODE);
+ free(xp, M_NULLFSNODE);
vp->v_op = &dead_vnodeops;
(void) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
vgone(vp);
@@ -218,12 +218,12 @@ null_nodeget(mp, lowervp, vpp)
* might cause a bogus v_data pointer to get dereferenced
* elsewhere if MALLOC should block.
*/
- MALLOC(xp, struct null_node *, sizeof(struct null_node),
+ xp = malloc(sizeof(struct null_node),
M_NULLFSNODE, M_WAITOK);
error = getnewvnode("null", mp, &null_vnodeops, &vp);
if (error) {
- FREE(xp, M_NULLFSNODE);
+ free(xp, M_NULLFSNODE);
return (error);
}
diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c
index 4a41396a6542..9b1edd953aee 100644
--- a/sys/fs/nullfs/null_vnops.c
+++ b/sys/fs/nullfs/null_vnops.c
@@ -677,7 +677,7 @@ null_reclaim(struct vop_reclaim_args *ap)
vput(lowervp);
} else
panic("null_reclaim: reclaiming a node with no lowervp");
- FREE(xp, M_NULLFSNODE);
+ free(xp, M_NULLFSNODE);
return (0);
}
diff --git a/sys/fs/nwfs/nwfs_node.c b/sys/fs/nwfs/nwfs_node.c
index 6082fded7173..29ad71c1450e 100644
--- a/sys/fs/nwfs/nwfs_node.c
+++ b/sys/fs/nwfs/nwfs_node.c
@@ -169,16 +169,16 @@ rescan:
* might cause a bogus v_data pointer to get dereferenced
* elsewhere if MALLOC should block.
*/
- MALLOC(np, struct nwnode *, sizeof *np, M_NWNODE, M_WAITOK | M_ZERO);
+ np = malloc(sizeof *np, M_NWNODE, M_WAITOK | M_ZERO);
error = getnewvnode("nwfs", mp, &nwfs_vnodeops, &vp);
if (error) {
*vpp = NULL;
- FREE(np, M_NWNODE);
+ free(np, M_NWNODE);
return (error);
}
error = insmntque(vp, mp); /* XXX: Too early for mpsafe fs */
if (error != 0) {
- FREE(np, M_NWNODE);
+ free(np, M_NWNODE);
*vpp = NULL;
return (error);
}
@@ -201,7 +201,7 @@ rescan:
vp->v_data = NULL;
np->n_vnode = NULL;
vrele(vp);
- FREE(np, M_NWNODE);
+ free(np, M_NWNODE);
goto rescan;
}
*vpp = vp;
@@ -283,7 +283,7 @@ nwfs_reclaim(ap)
nmp->n_root = NULL;
}
vp->v_data = NULL;
- FREE(np, M_NWNODE);
+ free(np, M_NWNODE);
if (dvp) {
vrele(dvp);
}
diff --git a/sys/fs/nwfs/nwfs_vfsops.c b/sys/fs/nwfs/nwfs_vfsops.c
index f795b7af7eff..a7880b601afd 100644
--- a/sys/fs/nwfs/nwfs_vfsops.c
+++ b/sys/fs/nwfs/nwfs_vfsops.c
@@ -114,7 +114,7 @@ nwfs_initnls(struct nwmount *nmp) {
nmp->m.nls.u2n = ncp_defnls.u2n;
return 0;
}
- MALLOC(pe, char *, 256 * 4, M_NWFSDATA, M_WAITOK);
+ pe = malloc(256 * 4, M_NWFSDATA, M_WAITOK);
pc = pe;
do {
COPY_TABLE(nmp->m.nls.to_lower, ncp_defnls.to_lower);
@@ -191,7 +191,7 @@ static int nwfs_mount(struct mount *mp, struct thread *td)
ncp_conn_unlock(conn, td); /* we keep the ref */
mp->mnt_stat.f_iosize = conn->buffer_size;
/* We must malloc our own mount info */
- MALLOC(nmp,struct nwmount *,sizeof(struct nwmount),M_NWFSDATA,
+ nmp = malloc(sizeof(struct nwmount),M_NWFSDATA,
M_WAITOK | M_USE_RESERVE | M_ZERO);
if (nmp == NULL) {
nwfs_printf("could not alloc nwmount\n");
diff --git a/sys/fs/portalfs/portal_vfsops.c b/sys/fs/portalfs/portal_vfsops.c
index cc02f13d384f..c2057c67c642 100644
--- a/sys/fs/portalfs/portal_vfsops.c
+++ b/sys/fs/portalfs/portal_vfsops.c
@@ -122,24 +122,24 @@ portal_mount(struct mount *mp, struct thread *td)
return (ESOCKTNOSUPPORT);
}
- MALLOC(pn, struct portalnode *, sizeof(struct portalnode),
+ pn = malloc(sizeof(struct portalnode),
M_TEMP, M_WAITOK);
- MALLOC(fmp, struct portalmount *, sizeof(struct portalmount),
+ fmp = malloc(sizeof(struct portalmount),
M_PORTALFSMNT, M_WAITOK); /* XXX */
error = getnewvnode("portal", mp, &portal_vnodeops, &rvp); /* XXX */
if (error) {
- FREE(fmp, M_PORTALFSMNT);
- FREE(pn, M_TEMP);
+ free(fmp, M_PORTALFSMNT);
+ free(pn, M_TEMP);
fdrop(fp, td);
return (error);
}
error = insmntque(rvp, mp); /* XXX: Too early for mpsafe fs */
if (error != 0) {
- FREE(fmp, M_PORTALFSMNT);
- FREE(pn, M_TEMP);
+ free(fmp, M_PORTALFSMNT);
+ free(pn, M_TEMP);
fdrop(fp, td);
return (error);
}
diff --git a/sys/fs/portalfs/portal_vnops.c b/sys/fs/portalfs/portal_vnops.c
index f05990c0ca12..8b49ad306ba0 100644
--- a/sys/fs/portalfs/portal_vnops.c
+++ b/sys/fs/portalfs/portal_vnops.c
@@ -127,12 +127,12 @@ portal_lookup(ap)
* might cause a bogus v_data pointer to get dereferenced
* elsewhere if MALLOC should block.
*/
- MALLOC(pt, struct portalnode *, sizeof(struct portalnode),
+ pt = malloc(sizeof(struct portalnode),
M_TEMP, M_WAITOK);
error = getnewvnode("portal", dvp->v_mount, &portal_vnodeops, &fvp);
if (error) {
- FREE(pt, M_TEMP);
+ free(pt, M_TEMP);
goto bad;
}
fvp->v_type = VREG;
@@ -542,7 +542,7 @@ portal_reclaim(ap)
free((caddr_t) pt->pt_arg, M_TEMP);
pt->pt_arg = 0;
}
- FREE(ap->a_vp->v_data, M_TEMP);
+ free(ap->a_vp->v_data, M_TEMP);
ap->a_vp->v_data = 0;
return (0);
diff --git a/sys/fs/pseudofs/pseudofs.c b/sys/fs/pseudofs/pseudofs.c
index eb2d67de9bf1..f7a042603c0b 100644
--- a/sys/fs/pseudofs/pseudofs.c
+++ b/sys/fs/pseudofs/pseudofs.c
@@ -71,7 +71,7 @@ pfs_alloc_node(struct pfs_info *pi, const char *name, pfs_type_t type)
KASSERT(strlen(name) < PFS_NAMELEN,
("%s(): node name is too long", __func__));
- MALLOC(pn, struct pfs_node *, sizeof *pn,
+ pn = malloc(sizeof *pn,
M_PFSNODES, M_WAITOK|M_ZERO);
mtx_init(&pn->pn_mutex, "pfs_node", NULL, MTX_DEF | MTX_DUPOK);
strlcpy(pn->pn_name, name, sizeof pn->pn_name);
@@ -290,7 +290,7 @@ pfs_destroy(struct pfs_node *pn)
/* destroy the node */
pfs_fileno_free(pn);
mtx_destroy(&pn->pn_mutex);
- FREE(pn, M_PFSNODES);
+ free(pn, M_PFSNODES);
return (0);
}
diff --git a/sys/fs/pseudofs/pseudofs_vncache.c b/sys/fs/pseudofs/pseudofs_vncache.c
index 2e8040fa6df9..eac35ebe58b1 100644
--- a/sys/fs/pseudofs/pseudofs_vncache.c
+++ b/sys/fs/pseudofs/pseudofs_vncache.c
@@ -149,7 +149,7 @@ retry:
++pfs_vncache_misses;
/* nope, get a new one */
- MALLOC(pvd, struct pfs_vdata *, sizeof *pvd, M_PFSVNCACHE, M_WAITOK);
+ pvd = malloc(sizeof *pvd, M_PFSVNCACHE, M_WAITOK);
mtx_lock(&pfs_vncache_mutex);
if (++pfs_vncache_entries > pfs_vncache_maxentries)
pfs_vncache_maxentries = pfs_vncache_entries;
@@ -159,7 +159,7 @@ retry:
mtx_lock(&pfs_vncache_mutex);
--pfs_vncache_entries;
mtx_unlock(&pfs_vncache_mutex);
- FREE(pvd, M_PFSVNCACHE);
+ free(pvd, M_PFSVNCACHE);
return (error);
}
pvd->pvd_pn = pn;
@@ -203,7 +203,7 @@ retry:
mtx_lock(&pfs_vncache_mutex);
--pfs_vncache_entries;
mtx_unlock(&pfs_vncache_mutex);
- FREE(pvd, M_PFSVNCACHE);
+ free(pvd, M_PFSVNCACHE);
*vpp = NULLVP;
return (error);
}
@@ -237,7 +237,7 @@ pfs_vncache_free(struct vnode *vp)
--pfs_vncache_entries;
mtx_unlock(&pfs_vncache_mutex);
- FREE(pvd, M_PFSVNCACHE);
+ free(pvd, M_PFSVNCACHE);
vp->v_data = NULL;
return (0);
}
diff --git a/sys/fs/smbfs/smbfs_node.c b/sys/fs/smbfs/smbfs_node.c
index 7ba7c5a09758..38464cd8a70b 100644
--- a/sys/fs/smbfs/smbfs_node.c
+++ b/sys/fs/smbfs/smbfs_node.c
@@ -229,15 +229,15 @@ loop:
if (fap == NULL)
return ENOENT;
- MALLOC(np, struct smbnode *, sizeof *np, M_SMBNODE, M_WAITOK);
+ np = malloc(sizeof *np, M_SMBNODE, M_WAITOK);
error = getnewvnode("smbfs", mp, &smbfs_vnodeops, &vp);
if (error) {
- FREE(np, M_SMBNODE);
+ free(np, M_SMBNODE);
return error;
}
error = insmntque(vp, mp); /* XXX: Too early for mpsafe fs */
if (error != 0) {
- FREE(np, M_SMBNODE);
+ free(np, M_SMBNODE);
return (error);
}
vp->v_type = fap->fa_attr & SMB_FA_DIR ? VDIR : VREG;
@@ -269,7 +269,7 @@ loop:
continue;
vput(vp);
/* smb_name_free(np->n_name);
- FREE(np, M_SMBNODE);*/
+ free(np, M_SMBNODE);*/
goto loop;
}
LIST_INSERT_HEAD(nhpp, np, n_hash);
@@ -335,7 +335,7 @@ smbfs_reclaim(ap)
smbfs_hash_unlock(smp);
if (np->n_name)
smbfs_name_free(np->n_name);
- FREE(np, M_SMBNODE);
+ free(np, M_SMBNODE);
if (dvp != NULL) {
vrele(dvp);
/*
diff --git a/sys/fs/smbfs/smbfs_vfsops.c b/sys/fs/smbfs/smbfs_vfsops.c
index a811e00cc8ce..9e1dc1656db1 100644
--- a/sys/fs/smbfs/smbfs_vfsops.c
+++ b/sys/fs/smbfs/smbfs_vfsops.c
@@ -179,7 +179,7 @@ smbfs_mount(struct mount *mp, struct thread *td)
#ifdef SMBFS_USEZONE
smp = zalloc(smbfsmount_zone);
#else
- MALLOC(smp, struct smbmount*, sizeof(*smp), M_SMBFSDATA,
+ smp = malloc(sizeof(*smp), M_SMBFSDATA,
M_WAITOK|M_USE_RESERVE);
#endif
if (smp == NULL) {
diff --git a/sys/fs/udf/udf_vfsops.c b/sys/fs/udf/udf_vfsops.c
index 6c0d7d013872..21ab1674517a 100644
--- a/sys/fs/udf/udf_vfsops.c
+++ b/sys/fs/udf/udf_vfsops.c
@@ -331,7 +331,7 @@ udf_mountfs(struct vnode *devvp, struct mount *mp) {
bo = &devvp->v_bufobj;
/* XXX: should be M_WAITOK */
- MALLOC(udfmp, struct udf_mnt *, sizeof(struct udf_mnt), M_UDFMOUNT,
+ udfmp = malloc(sizeof(struct udf_mnt), M_UDFMOUNT,
M_NOWAIT | M_ZERO);
if (udfmp == NULL) {
printf("Cannot allocate UDF mount struct\n");
@@ -488,7 +488,7 @@ udf_mountfs(struct vnode *devvp, struct mount *mp) {
bail:
if (udfmp != NULL)
- FREE(udfmp, M_UDFMOUNT);
+ free(udfmp, M_UDFMOUNT);
if (bp != NULL)
brelse(bp);
DROP_GIANT();
@@ -530,9 +530,9 @@ udf_unmount(struct mount *mp, int mntflags, struct thread *td)
vrele(udfmp->im_devvp);
if (udfmp->s_table != NULL)
- FREE(udfmp->s_table, M_UDFMOUNT);
+ free(udfmp->s_table, M_UDFMOUNT);
- FREE(udfmp, M_UDFMOUNT);
+ free(udfmp, M_UDFMOUNT);
mp->mnt_data = NULL;
MNT_ILOCK(mp);
@@ -647,7 +647,7 @@ udf_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
return (ENOMEM);
}
size = UDF_FENTRY_SIZE + le32toh(fe->l_ea) + le32toh(fe->l_ad);
- MALLOC(unode->fentry, struct file_entry *, size, M_UDFFENTRY,
+ unode->fentry = malloc(size, M_UDFFENTRY,
M_NOWAIT | M_ZERO);
if (unode->fentry == NULL) {
printf("Cannot allocate file entry block\n");
@@ -757,8 +757,7 @@ udf_find_partmaps(struct udf_mnt *udfmp, struct logvol_desc *lvd)
pms = (struct part_map_spare *)pmap;
pmap += UDF_PMAP_TYPE2_SIZE;
- MALLOC(udfmp->s_table, struct udf_sparing_table *,
- le32toh(pms->st_size), M_UDFMOUNT, M_NOWAIT | M_ZERO);
+ udfmp->s_table = malloc( le32toh(pms->st_size), M_UDFMOUNT, M_NOWAIT | M_ZERO);
if (udfmp->s_table == NULL)
return (ENOMEM);
@@ -776,7 +775,7 @@ udf_find_partmaps(struct udf_mnt *udfmp, struct logvol_desc *lvd)
brelse(bp);
printf("Failed to read Sparing Table at sector %d\n",
le32toh(pms->st_loc[0]));
- FREE(udfmp->s_table, M_UDFMOUNT);
+ free(udfmp->s_table, M_UDFMOUNT);
return (error);
}
bcopy(bp->b_data, udfmp->s_table, le32toh(pms->st_size));
@@ -784,7 +783,7 @@ udf_find_partmaps(struct udf_mnt *udfmp, struct logvol_desc *lvd)
if (udf_checktag(&udfmp->s_table->tag, 0)) {
printf("Invalid sparing table found\n");
- FREE(udfmp->s_table, M_UDFMOUNT);
+ free(udfmp->s_table, M_UDFMOUNT);
return (EINVAL);
}
diff --git a/sys/fs/udf/udf_vnops.c b/sys/fs/udf/udf_vnops.c
index 26d5b18f1925..d468890e7a11 100644
--- a/sys/fs/udf/udf_vnops.c
+++ b/sys/fs/udf/udf_vnops.c
@@ -574,7 +574,7 @@ udf_getfid(struct udf_dirstream *ds)
*/
if (ds->fid_fragment && ds->buf != NULL) {
ds->fid_fragment = 0;
- FREE(ds->buf, M_UDFFID);
+ free(ds->buf, M_UDFFID);
}
fid = (struct fileid_desc*)&ds->data[ds->off];
@@ -599,7 +599,7 @@ udf_getfid(struct udf_dirstream *ds)
* File ID descriptors can only be at most one
* logical sector in size.
*/
- MALLOC(ds->buf, uint8_t*, ds->udfmp->bsize, M_UDFFID,
+ ds->buf = malloc(ds->udfmp->bsize, M_UDFFID,
M_WAITOK | M_ZERO);
bcopy(fid, ds->buf, frag_size);
@@ -668,7 +668,7 @@ udf_closedir(struct udf_dirstream *ds)
brelse(ds->bp);
if (ds->fid_fragment && ds->buf != NULL)
- FREE(ds->buf, M_UDFFID);
+ free(ds->buf, M_UDFFID);
uma_zfree(udf_zone_ds, ds);
}
@@ -701,7 +701,7 @@ udf_readdir(struct vop_readdir_args *a)
* it left off.
*/
ncookies = uio->uio_resid / 8;
- MALLOC(cookies, u_long *, sizeof(u_long) * ncookies,
+ cookies = malloc(sizeof(u_long) * ncookies,
M_TEMP, M_WAITOK);
if (cookies == NULL)
return (ENOMEM);
@@ -787,7 +787,7 @@ udf_readdir(struct vop_readdir_args *a)
if (a->a_ncookies != NULL) {
if (error)
- FREE(cookies, M_TEMP);
+ free(cookies, M_TEMP);
else {
*a->a_ncookies = uiodir.acookies;
*a->a_cookies = cookies;
@@ -1028,7 +1028,7 @@ udf_reclaim(struct vop_reclaim_args *a)
vfs_hash_remove(vp);
if (unode->fentry != NULL)
- FREE(unode->fentry, M_UDFFENTRY);
+ free(unode->fentry, M_UDFFENTRY);
uma_zfree(udf_zone_node, unode);
vp->v_data = NULL;
}
diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c
index cb9af5ab8e0a..d4c1e60aa90e 100644
--- a/sys/fs/unionfs/union_subr.c
+++ b/sys/fs/unionfs/union_subr.c
@@ -257,17 +257,17 @@ unionfs_nodeget(struct mount *mp, struct vnode *uppervp,
* might cause a bogus v_data pointer to get dereferenced elsewhere
* if MALLOC should block.
*/
- MALLOC(unp, struct unionfs_node *, sizeof(struct unionfs_node),
+ unp = malloc(sizeof(struct unionfs_node),
M_UNIONFSNODE, M_WAITOK | M_ZERO);
error = getnewvnode("unionfs", mp, &unionfs_vnodeops, &vp);
if (error != 0) {
- FREE(unp, M_UNIONFSNODE);
+ free(unp, M_UNIONFSNODE);
return (error);
}
error = insmntque(vp, mp); /* XXX: Too early for mpsafe fs */
if (error != 0) {
- FREE(unp, M_UNIONFSNODE);
+ free(unp, M_UNIONFSNODE);
return (error);
}
if (dvp != NULLVP)
@@ -415,7 +415,7 @@ unionfs_noderem(struct vnode *vp, struct thread *td)
LIST_REMOVE(unsp, uns_list);
free(unsp, M_TEMP);
}
- FREE(unp, M_UNIONFSNODE);
+ free(unp, M_UNIONFSNODE);
}
/*
@@ -440,8 +440,7 @@ unionfs_get_node_status(struct unionfs_node *unp, struct thread *td,
}
/* create a new unionfs node status */
- MALLOC(unsp, struct unionfs_node_status *,
- sizeof(struct unionfs_node_status), M_TEMP, M_WAITOK | M_ZERO);
+ unsp = malloc( sizeof(struct unionfs_node_status), M_TEMP, M_WAITOK | M_ZERO);
unsp->uns_pid = pid;
LIST_INSERT_HEAD(&(unp->un_unshead), unsp, uns_list);
diff --git a/sys/gnu/fs/ext2fs/ext2_inode.c b/sys/gnu/fs/ext2fs/ext2_inode.c
index 086f73957976..e0b79ba85109 100644
--- a/sys/gnu/fs/ext2fs/ext2_inode.c
+++ b/sys/gnu/fs/ext2fs/ext2_inode.c
@@ -409,7 +409,7 @@ ext2_indirtrunc(ip, lbn, dbn, lastbn, level, countp)
}
bap = (int32_t *)bp->b_data;
- MALLOC(copy, int32_t *, fs->s_blocksize, M_TEMP, M_WAITOK);
+ copy = malloc(fs->s_blocksize, M_TEMP, M_WAITOK);
bcopy((caddr_t)bap, (caddr_t)copy, (u_int)fs->s_blocksize);
bzero((caddr_t)&bap[last + 1],
(u_int)(NINDIR(fs) - (last + 1)) * sizeof (int32_t));
@@ -451,7 +451,7 @@ ext2_indirtrunc(ip, lbn, dbn, lastbn, level, countp)
blocksreleased += blkcount;
}
}
- FREE(copy, M_TEMP);
+ free(copy, M_TEMP);
*countp = blocksreleased;
return (allerror);
}
@@ -521,7 +521,7 @@ ext2_reclaim(ap)
ext2_update(vp, 0);
}
vfs_hash_remove(vp);
- FREE(vp->v_data, M_EXT2NODE);
+ free(vp->v_data, M_EXT2NODE);
vp->v_data = 0;
vnode_destroy_vobject(vp);
return (0);
diff --git a/sys/gnu/fs/ext2fs/ext2_lookup.c b/sys/gnu/fs/ext2fs/ext2_lookup.c
index 1d470009cfbf..7788d584ae75 100644
--- a/sys/gnu/fs/ext2fs/ext2_lookup.c
+++ b/sys/gnu/fs/ext2fs/ext2_lookup.c
@@ -177,7 +177,7 @@ ext2_readdir(ap)
auio.uio_resid = count;
auio.uio_segflg = UIO_SYSSPACE;
aiov.iov_len = count;
- MALLOC(dirbuf, caddr_t, count, M_TEMP, M_WAITOK);
+ dirbuf = malloc(count, M_TEMP, M_WAITOK);
aiov.iov_base = dirbuf;
error = VOP_READ(ap->a_vp, &auio, 0, ap->a_cred);
if (error == 0) {
@@ -237,7 +237,7 @@ ext2_readdir(ap)
if (uio->uio_segflg != UIO_SYSSPACE || uio->uio_iovcnt != 1)
panic("ext2_readdir: unexpected uio from NFS server");
- MALLOC(cookies, u_long *, ncookies * sizeof(u_long), M_TEMP,
+ cookies = malloc(ncookies * sizeof(u_long), M_TEMP,
M_WAITOK);
off = startoffset;
for (dp = (struct ext2_dir_entry_2 *)dirbuf,
@@ -251,7 +251,7 @@ ext2_readdir(ap)
*ap->a_cookies = cookies;
}
}
- FREE(dirbuf, M_TEMP);
+ free(dirbuf, M_TEMP);
if (ap->a_eofflag)
*ap->a_eofflag = VTOI(ap->a_vp)->i_size <= uio->uio_offset;
return (error);
diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c
index b7f766c1d21e..5e3c56c84cc7 100644
--- a/sys/gnu/fs/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c
@@ -964,7 +964,7 @@ ext2_vget(mp, ino, flags, vpp)
dev = ump->um_dev;
/*
- * If this MALLOC() is performed after the getnewvnode()
+ * If this malloc() is performed after the getnewvnode()
* it might block, leaving a vnode with a NULL v_data to be
* found by ext2_sync() if a sync happens to fire right then,
* which will cause a panic because ext2_sync() blindly
diff --git a/sys/gnu/fs/reiserfs/reiserfs_inode.c b/sys/gnu/fs/reiserfs/reiserfs_inode.c
index 26288c56ecb2..46edbf4bf579 100644
--- a/sys/gnu/fs/reiserfs/reiserfs_inode.c
+++ b/sys/gnu/fs/reiserfs/reiserfs_inode.c
@@ -157,7 +157,7 @@ reiserfs_reclaim(struct vop_reclaim_args *ap)
vfs_hash_remove(vp);
reiserfs_log(LOG_DEBUG, "free private data\n");
- FREE(vp->v_data, M_REISERFSNODE);
+ free(vp->v_data, M_REISERFSNODE);
vp->v_data = NULL;
vnode_destroy_vobject(vp);
@@ -764,7 +764,7 @@ reiserfs_iget(
dev = rmp->rm_dev;
/*
- * If this MALLOC() is performed after the getnewvnode() it might
+ * If this malloc() is performed after the getnewvnode() it might
* block, leaving a vnode with a NULL v_data to be found by
* reiserfs_sync() if a sync happens to fire right then, which
* will cause a panic because reiserfs_sync() blindly dereferences
diff --git a/sys/gnu/fs/reiserfs/reiserfs_vfsops.c b/sys/gnu/fs/reiserfs/reiserfs_vfsops.c
index 8621818ac644..7ffac9632b46 100644
--- a/sys/gnu/fs/reiserfs/reiserfs_vfsops.c
+++ b/sys/gnu/fs/reiserfs/reiserfs_vfsops.c
@@ -929,7 +929,7 @@ get_root_node(struct reiserfs_mount *rmp, struct reiserfs_node **root)
/* Allocate the node structure */
reiserfs_log(LOG_DEBUG, "malloc(struct reiserfs_node)\n");
- MALLOC(ip, struct reiserfs_node *, sizeof(struct reiserfs_node),
+ ip = malloc(sizeof(struct reiserfs_node),
M_REISERFSNODE, M_WAITOK | M_ZERO);
/* Fill the structure */
diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c
index 7619db7c22da..a6bcbd20dd52 100644
--- a/sys/i386/i386/sys_machdep.c
+++ b/sys/i386/i386/sys_machdep.c
@@ -437,14 +437,14 @@ user_ldt_alloc(struct mdproc *mdp, int len)
mtx_assert(&dt_lock, MA_OWNED);
mtx_unlock_spin(&dt_lock);
- MALLOC(new_ldt, struct proc_ldt *, sizeof(struct proc_ldt),
+ new_ldt = malloc(sizeof(struct proc_ldt),
M_SUBPROC, M_WAITOK);
new_ldt->ldt_len = len = NEW_MAX_LD(len);
new_ldt->ldt_base = (caddr_t)kmem_alloc(kernel_map,
round_page(len * sizeof(union descriptor)));
if (new_ldt->ldt_base == NULL) {
- FREE(new_ldt, M_SUBPROC);
+ free(new_ldt, M_SUBPROC);
mtx_lock_spin(&dt_lock);
return (NULL);
}
@@ -474,14 +474,14 @@ user_ldt_alloc(struct mdproc *mdp, int len)
mtx_assert(&dt_lock, MA_OWNED);
mtx_unlock_spin(&dt_lock);
- MALLOC(new_ldt, struct proc_ldt *, sizeof(struct proc_ldt),
+ new_ldt = malloc(sizeof(struct proc_ldt),
M_SUBPROC, M_WAITOK);
new_ldt->ldt_len = len = NEW_MAX_LD(len);
new_ldt->ldt_base = (caddr_t)kmem_alloc(kernel_map,
len * sizeof(union descriptor));
if (new_ldt->ldt_base == NULL) {
- FREE(new_ldt, M_SUBPROC);
+ free(new_ldt, M_SUBPROC);
mtx_lock_spin(&dt_lock);
return (NULL);
}
@@ -538,7 +538,7 @@ user_ldt_deref(struct proc_ldt *pldt)
mtx_unlock_spin(&dt_lock);
kmem_free(kernel_map, (vm_offset_t)pldt->ldt_base,
pldt->ldt_len * sizeof(union descriptor));
- FREE(pldt, M_SUBPROC);
+ free(pldt, M_SUBPROC);
} else
mtx_unlock_spin(&dt_lock);
}
@@ -815,7 +815,7 @@ i386_ldt_grow(struct thread *td, int len)
kmem_free(kernel_map,
(vm_offset_t)new_ldt->ldt_base,
new_ldt->ldt_len * sizeof(union descriptor));
- FREE(new_ldt, M_SUBPROC);
+ free(new_ldt, M_SUBPROC);
mtx_lock_spin(&dt_lock);
return (0);
}
@@ -848,7 +848,7 @@ i386_ldt_grow(struct thread *td, int len)
if (old_ldt_base != NULL_LDT_BASE) {
kmem_free(kernel_map, (vm_offset_t)old_ldt_base,
old_ldt_len * sizeof(union descriptor));
- FREE(new_ldt, M_SUBPROC);
+ free(new_ldt, M_SUBPROC);
}
mtx_lock_spin(&dt_lock);
}
diff --git a/sys/ia64/ia64/sscdisk.c b/sys/ia64/ia64/sscdisk.c
index 2c5ef691cb95..0d5e32190ccb 100644
--- a/sys/ia64/ia64/sscdisk.c
+++ b/sys/ia64/ia64/sscdisk.c
@@ -165,7 +165,7 @@ ssccreate(int unit)
if (sc->unit == unit)
return (NULL);
}
- MALLOC(sc, struct ssc_s *,sizeof(*sc), M_SSC, M_WAITOK | M_ZERO);
+ sc = malloc(sizeof(*sc), M_SSC, M_WAITOK | M_ZERO);
LIST_INSERT_HEAD(&ssc_softc_list, sc, list);
sc->unit = unit;
bioq_init(&sc->bio_queue);
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index f3dd227f505e..4ccc37ee87bc 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -852,7 +852,7 @@ funsetown(struct sigio **sigiop)
}
SIGIO_UNLOCK();
crfree(sigio->sio_ucred);
- FREE(sigio, M_SIGIO);
+ free(sigio, M_SIGIO);
}
/*
@@ -910,7 +910,7 @@ funsetownlst(struct sigiolst *sigiolst)
}
SIGIO_UNLOCK();
crfree(sigio->sio_ucred);
- FREE(sigio, M_SIGIO);
+ free(sigio, M_SIGIO);
SIGIO_LOCK();
}
SIGIO_UNLOCK();
@@ -938,7 +938,7 @@ fsetown(pid_t pgid, struct sigio **sigiop)
ret = 0;
/* Allocate and fill in the new sigio out of locks. */
- MALLOC(sigio, struct sigio *, sizeof(struct sigio), M_SIGIO, M_WAITOK);
+ sigio = malloc(sizeof(struct sigio), M_SIGIO, M_WAITOK);
sigio->sio_pgid = pgid;
sigio->sio_ucred = crhold(curthread->td_ucred);
sigio->sio_myref = sigiop;
@@ -1020,7 +1020,7 @@ fsetown(pid_t pgid, struct sigio **sigiop)
fail:
sx_sunlock(&proctree_lock);
crfree(sigio->sio_ucred);
- FREE(sigio, M_SIGIO);
+ free(sigio, M_SIGIO);
return (ret);
}
@@ -1287,11 +1287,11 @@ fdgrowtable(struct filedesc *fdp, int nfd)
/* allocate a new table and (if required) new bitmaps */
FILEDESC_XUNLOCK(fdp);
- MALLOC(ntable, struct file **, nnfiles * OFILESIZE,
+ ntable = malloc(nnfiles * OFILESIZE,
M_FILEDESC, M_ZERO | M_WAITOK);
nfileflags = (char *)&ntable[nnfiles];
if (NDSLOTS(nnfiles) > NDSLOTS(onfiles))
- MALLOC(nmap, NDSLOTTYPE *, NDSLOTS(nnfiles) * NDSLOTSIZE,
+ nmap = malloc(NDSLOTS(nnfiles) * NDSLOTSIZE,
M_FILEDESC, M_ZERO | M_WAITOK);
else
nmap = NULL;
@@ -1521,7 +1521,7 @@ fddrop(struct filedesc *fdp)
return;
FILEDESC_LOCK_DESTROY(fdp);
- FREE(fdp, M_FILEDESC);
+ free(fdp, M_FILEDESC);
}
/*
@@ -1696,7 +1696,7 @@ fdfree(struct thread *td)
td->td_proc->p_fdtol = NULL;
FILEDESC_XUNLOCK(fdp);
if (fdtol != NULL)
- FREE(fdtol, M_FILEDESC_TO_LEADER);
+ free(fdtol, M_FILEDESC_TO_LEADER);
}
FILEDESC_XLOCK(fdp);
i = --fdp->fd_refcnt;
@@ -1720,9 +1720,9 @@ fdfree(struct thread *td)
mtx_unlock(&fdesc_mtx);
if (fdp->fd_nfiles > NDFILE)
- FREE(fdp->fd_ofiles, M_FILEDESC);
+ free(fdp->fd_ofiles, M_FILEDESC);
if (NDSLOTS(fdp->fd_nfiles) > NDSLOTS(NDFILE))
- FREE(fdp->fd_map, M_FILEDESC);
+ free(fdp->fd_map, M_FILEDESC);
fdp->fd_nfiles = 0;
@@ -2409,8 +2409,7 @@ filedesc_to_leader_alloc(struct filedesc_to_leader *old, struct filedesc *fdp, s
{
struct filedesc_to_leader *fdtol;
- MALLOC(fdtol, struct filedesc_to_leader *,
- sizeof(struct filedesc_to_leader),
+ fdtol = malloc( sizeof(struct filedesc_to_leader),
M_FILEDESC_TO_LEADER,
M_WAITOK);
fdtol->fdl_refcount = 1;
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index ab3cbb7abde0..6a631bef69c7 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -529,7 +529,7 @@ filt_timerattach(struct knote *kn)
kn->kn_flags |= EV_CLEAR; /* automatically set */
kn->kn_status &= ~KN_DETACHED; /* knlist_add usually sets it */
- MALLOC(calloutp, struct callout *, sizeof(*calloutp),
+ calloutp = malloc(sizeof(*calloutp),
M_KQUEUE, M_WAITOK);
callout_init(calloutp, CALLOUT_MPSAFE);
kn->kn_hook = calloutp;
@@ -547,7 +547,7 @@ filt_timerdetach(struct knote *kn)
calloutp = (struct callout *)kn->kn_hook;
callout_drain(calloutp);
- FREE(calloutp, M_KQUEUE);
+ free(calloutp, M_KQUEUE);
atomic_add_int(&kq_ncallouts, -1);
kn->kn_status |= KN_DETACHED; /* knlist_remove usually clears it */
}
@@ -1109,19 +1109,18 @@ kqueue_expand(struct kqueue *kq, struct filterops *fops, uintptr_t ident,
size = kq->kq_knlistsize;
while (size <= fd)
size += KQEXTENT;
- MALLOC(list, struct klist *,
- size * sizeof list, M_KQUEUE, mflag);
+ list = malloc( size * sizeof list, M_KQUEUE, mflag);
if (list == NULL)
return ENOMEM;
KQ_LOCK(kq);
if (kq->kq_knlistsize > fd) {
- FREE(list, M_KQUEUE);
+ free(list, M_KQUEUE);
list = NULL;
} else {
if (kq->kq_knlist != NULL) {
bcopy(kq->kq_knlist, list,
kq->kq_knlistsize * sizeof list);
- FREE(kq->kq_knlist, M_KQUEUE);
+ free(kq->kq_knlist, M_KQUEUE);
kq->kq_knlist = NULL;
}
bzero((caddr_t)list +
diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c
index 654b56f5dbbd..3afbc918be90 100644
--- a/sys/kern/kern_jail.c
+++ b/sys/kern/kern_jail.c
@@ -137,7 +137,7 @@ jail(struct thread *td, struct jail_args *uap)
if (j.version != 0)
return (EINVAL);
- MALLOC(pr, struct prison *, sizeof(*pr), M_PRISON, M_WAITOK | M_ZERO);
+ pr = malloc(sizeof(*pr), M_PRISON, M_WAITOK | M_ZERO);
mtx_init(&pr->pr_mtx, "jail mutex", NULL, MTX_DEF);
pr->pr_ref = 1;
error = copyinstr(j.path, &pr->pr_path, sizeof(pr->pr_path), 0);
@@ -211,13 +211,13 @@ e_dropprref:
sx_sunlock(&allprison_lock);
e_dropvnref:
if (pr->pr_slots != NULL)
- FREE(pr->pr_slots, M_PRISON);
+ free(pr->pr_slots, M_PRISON);
vfslocked = VFS_LOCK_GIANT(pr->pr_root->v_mount);
vrele(pr->pr_root);
VFS_UNLOCK_GIANT(vfslocked);
e_killmtx:
mtx_destroy(&pr->pr_mtx);
- FREE(pr, M_PRISON);
+ free(pr, M_PRISON);
return (error);
}
@@ -343,7 +343,7 @@ prison_complete(void *context, int pending)
}
sx_sunlock(&allprison_lock);
if (pr->pr_slots != NULL)
- FREE(pr->pr_slots, M_PRISON);
+ free(pr->pr_slots, M_PRISON);
vfslocked = VFS_LOCK_GIANT(pr->pr_root->v_mount);
vrele(pr->pr_root);
@@ -351,8 +351,8 @@ prison_complete(void *context, int pending)
mtx_destroy(&pr->pr_mtx);
if (pr->pr_linux != NULL)
- FREE(pr->pr_linux, M_PRISON);
- FREE(pr, M_PRISON);
+ free(pr->pr_linux, M_PRISON);
+ free(pr, M_PRISON);
}
void
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c
index 9f322d791f69..6cc5d5d99f44 100644
--- a/sys/kern/kern_linker.c
+++ b/sys/kern/kern_linker.c
@@ -1893,14 +1893,13 @@ linker_hwpmc_list_objects(void)
retry:
/* allocate nmappings+1 entries */
- MALLOC(hc.kobase, struct pmckern_map_in *,
- (hc.nmappings + 1) * sizeof(struct pmckern_map_in), M_LINKER,
+ hc.kobase = malloc( (hc.nmappings + 1) * sizeof(struct pmckern_map_in), M_LINKER,
M_WAITOK | M_ZERO);
hc.nobjects = 0;
if (linker_file_foreach(linker_hwpmc_list_object, &hc) != 0) {
hc.nmappings = hc.nobjects;
- FREE(hc.kobase, M_LINKER);
+ free(hc.kobase, M_LINKER);
goto retry;
}
diff --git a/sys/kern/kern_mtxpool.c b/sys/kern/kern_mtxpool.c
index aab28b6fba40..6a98fea01745 100644
--- a/sys/kern/kern_mtxpool.c
+++ b/sys/kern/kern_mtxpool.c
@@ -146,8 +146,7 @@ mtx_pool_create(const char *mtx_name, int pool_size, int opts)
mtx_name);
pool_size = 128;
}
- MALLOC(pool, struct mtx_pool *,
- sizeof (struct mtx_pool) + ((pool_size - 1) * sizeof (struct mtx)),
+ pool = malloc( sizeof (struct mtx_pool) + ((pool_size - 1) * sizeof (struct mtx)),
M_MTXPOOL, M_WAITOK | M_ZERO);
mtx_pool_initialize(pool, mtx_name, pool_size, opts);
return pool;
@@ -161,7 +160,7 @@ mtx_pool_destroy(struct mtx_pool **poolp)
for (i = pool->mtx_pool_size - 1; i >= 0; --i)
mtx_destroy(&pool->mtx_pool_ary[i]);
- FREE(pool, M_MTXPOOL);
+ free(pool, M_MTXPOOL);
*poolp = NULL;
}
@@ -208,7 +207,7 @@ mtx_pool_alloc(struct mtx_pool *pool)
* memory allocator. The lockmgr subsystem is initialized by
* SYSINIT(..., SI_SUB_LOCKMGR, ...).
*
- * We can't call MALLOC() to dynamically allocate the sleep pool
+ * We can't call malloc() to dynamically allocate the sleep pool
* until after kmeminit() has been called, which is done by
* SYSINIT(..., SI_SUB_KMEM, ...).
*/
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index e45a4890fbe1..02e6c41f27c3 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -509,7 +509,7 @@ pgdelete(pgrp)
}
mtx_destroy(&pgrp->pg_mtx);
- FREE(pgrp, M_PGRP);
+ free(pgrp, M_PGRP);
sess_release(savesess);
}
@@ -629,7 +629,7 @@ sess_release(struct session *s)
tty_rel_sess(s->s_ttyp, s);
}
mtx_destroy(&s->s_mtx);
- FREE(s, M_SESSION);
+ free(s, M_SESSION);
}
}
@@ -1173,7 +1173,7 @@ pargs_alloc(int len)
{
struct pargs *pa;
- MALLOC(pa, struct pargs *, sizeof(struct pargs) + len, M_PARGS,
+ pa = malloc(sizeof(struct pargs) + len, M_PARGS,
M_WAITOK);
refcount_init(&pa->ar_ref, 1);
pa->ar_length = len;
@@ -1184,7 +1184,7 @@ static void
pargs_free(struct pargs *pa)
{
- FREE(pa, M_PARGS);
+ free(pa, M_PARGS);
}
void
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index bbd4fd5bf243..348acdf131a2 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -326,8 +326,8 @@ setsid(register struct thread *td, struct setsid_args *uap)
error = 0;
pgrp = NULL;
- MALLOC(newpgrp, struct pgrp *, sizeof(struct pgrp), M_PGRP, M_WAITOK | M_ZERO);
- MALLOC(newsess, struct session *, sizeof(struct session), M_SESSION, M_WAITOK | M_ZERO);
+ newpgrp = malloc(sizeof(struct pgrp), M_PGRP, M_WAITOK | M_ZERO);
+ newsess = malloc(sizeof(struct session), M_SESSION, M_WAITOK | M_ZERO);
sx_xlock(&proctree_lock);
@@ -345,9 +345,9 @@ setsid(register struct thread *td, struct setsid_args *uap)
sx_xunlock(&proctree_lock);
if (newpgrp != NULL)
- FREE(newpgrp, M_PGRP);
+ free(newpgrp, M_PGRP);
if (newsess != NULL)
- FREE(newsess, M_SESSION);
+ free(newsess, M_SESSION);
return (error);
}
@@ -386,7 +386,7 @@ setpgid(struct thread *td, register struct setpgid_args *uap)
error = 0;
- MALLOC(newpgrp, struct pgrp *, sizeof(struct pgrp), M_PGRP, M_WAITOK | M_ZERO);
+ newpgrp = malloc(sizeof(struct pgrp), M_PGRP, M_WAITOK | M_ZERO);
sx_xlock(&proctree_lock);
if (uap->pid != 0 && uap->pid != curp->p_pid) {
@@ -450,7 +450,7 @@ done:
KASSERT((error == 0) || (newpgrp != NULL),
("setpgid failed and newpgrp is NULL"));
if (newpgrp != NULL)
- FREE(newpgrp, M_PGRP);
+ free(newpgrp, M_PGRP);
return (error);
}
@@ -1778,7 +1778,7 @@ crget(void)
{
register struct ucred *cr;
- MALLOC(cr, struct ucred *, sizeof(*cr), M_CRED, M_WAITOK | M_ZERO);
+ cr = malloc(sizeof(*cr), M_CRED, M_WAITOK | M_ZERO);
refcount_init(&cr->cr_ref, 1);
#ifdef AUDIT
audit_cred_init(cr);
@@ -1830,7 +1830,7 @@ crfree(struct ucred *cr)
#ifdef MAC
mac_cred_destroy(cr);
#endif
- FREE(cr, M_CRED);
+ free(cr, M_CRED);
}
}
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
index 0a67a5bc9282..6e734776a2db 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -1268,7 +1268,7 @@ uifree(uip)
if (uip->ui_proccnt != 0)
printf("freeing uidinfo: uid = %d, proccnt = %ld\n",
uip->ui_uid, uip->ui_proccnt);
- FREE(uip, M_UIDINFO);
+ free(uip, M_UIDINFO);
return;
}
/*
diff --git a/sys/kern/subr_blist.c b/sys/kern/subr_blist.c
index 335764680dcb..d4459a20bf9c 100644
--- a/sys/kern/subr_blist.c
+++ b/sys/kern/subr_blist.c
@@ -554,7 +554,7 @@ blst_meta_free(
int next_skip = ((u_int)skip / BLIST_META_RADIX);
#if 0
- printf("FREE (%llx,%lld) FROM (%llx,%lld)\n",
+ printf("free (%llx,%lld) FROM (%llx,%lld)\n",
(long long)freeBlk, (long long)count,
(long long)blk, (long long)radix
);
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c
index 48c4b5c35b61..790e90fbe89f 100644
--- a/sys/kern/subr_witness.c
+++ b/sys/kern/subr_witness.c
@@ -708,8 +708,7 @@ witness_initialize(void *dummy __unused)
struct witness *w, *w1;
int i;
- MALLOC(w_data, struct witness *,
- sizeof (struct witness) * WITNESS_COUNT, M_WITNESS,
+ w_data = malloc( sizeof (struct witness) * WITNESS_COUNT, M_WITNESS,
M_NOWAIT | M_ZERO);
/*
diff --git a/sys/kern/uipc_accf.c b/sys/kern/uipc_accf.c
index 4449b5bc5c68..102c04f26630 100644
--- a/sys/kern/uipc_accf.c
+++ b/sys/kern/uipc_accf.c
@@ -84,7 +84,7 @@ accept_filt_add(struct accept_filter *filt)
} else {
p->accf_callback = filt->accf_callback;
ACCEPT_FILTER_UNLOCK();
- FREE(filt, M_ACCF);
+ free(filt, M_ACCF);
return (0);
}
}
@@ -131,7 +131,7 @@ accept_filt_generic_mod_event(module_t mod, int event, void *data)
switch (event) {
case MOD_LOAD:
- MALLOC(p, struct accept_filter *, sizeof(*p), M_ACCF,
+ p = malloc(sizeof(*p), M_ACCF,
M_WAITOK);
bcopy(accfp, p, sizeof(*p));
error = accept_filt_add(p);
@@ -169,7 +169,7 @@ do_getopt_accept_filter(struct socket *so, struct sockopt *sopt)
int error;
error = 0;
- MALLOC(afap, struct accept_filter_arg *, sizeof(*afap), M_TEMP,
+ afap = malloc(sizeof(*afap), M_TEMP,
M_WAITOK | M_ZERO);
SOCK_LOCK(so);
if ((so->so_options & SO_ACCEPTCONN) == 0) {
@@ -187,7 +187,7 @@ out:
SOCK_UNLOCK(so);
if (error == 0)
error = sooptcopyout(sopt, afap, sizeof(*afap));
- FREE(afap, M_TEMP);
+ free(afap, M_TEMP);
return (error);
}
@@ -215,8 +215,8 @@ do_setopt_accept_filter(struct socket *so, struct sockopt *sopt)
af->so_accept_filter->accf_destroy(so);
}
if (af->so_accept_filter_str != NULL)
- FREE(af->so_accept_filter_str, M_ACCF);
- FREE(af, M_ACCF);
+ free(af->so_accept_filter_str, M_ACCF);
+ free(af, M_ACCF);
so->so_accf = NULL;
}
so->so_options &= ~SO_ACCEPTFILTER;
@@ -228,18 +228,18 @@ do_setopt_accept_filter(struct socket *so, struct sockopt *sopt)
* Pre-allocate any memory we may need later to avoid blocking at
* untimely moments. This does not optimize for invalid arguments.
*/
- MALLOC(afap, struct accept_filter_arg *, sizeof(*afap), M_TEMP,
+ afap = malloc(sizeof(*afap), M_TEMP,
M_WAITOK);
error = sooptcopyin(sopt, afap, sizeof *afap, sizeof *afap);
afap->af_name[sizeof(afap->af_name)-1] = '\0';
afap->af_arg[sizeof(afap->af_arg)-1] = '\0';
if (error) {
- FREE(afap, M_TEMP);
+ free(afap, M_TEMP);
return (error);
}
afp = accept_filt_get(afap->af_name);
if (afp == NULL) {
- FREE(afap, M_TEMP);
+ free(afap, M_TEMP);
return (ENOENT);
}
/*
@@ -248,11 +248,11 @@ do_setopt_accept_filter(struct socket *so, struct sockopt *sopt)
* attached properly, 'newaf' is NULLed to avoid a free()
* while in use.
*/
- MALLOC(newaf, struct so_accf *, sizeof(*newaf), M_ACCF, M_WAITOK |
+ newaf = malloc(sizeof(*newaf), M_ACCF, M_WAITOK |
M_ZERO);
if (afp->accf_create != NULL && afap->af_name[0] != '\0') {
int len = strlen(afap->af_name) + 1;
- MALLOC(newaf->so_accept_filter_str, char *, len, M_ACCF,
+ newaf->so_accept_filter_str = malloc(len, M_ACCF,
M_WAITOK);
strcpy(newaf->so_accept_filter_str, afap->af_name);
}
@@ -289,10 +289,10 @@ out:
SOCK_UNLOCK(so);
if (newaf != NULL) {
if (newaf->so_accept_filter_str != NULL)
- FREE(newaf->so_accept_filter_str, M_ACCF);
- FREE(newaf, M_ACCF);
+ free(newaf->so_accept_filter_str, M_ACCF);
+ free(newaf, M_ACCF);
}
if (afap != NULL)
- FREE(afap, M_TEMP);
+ free(afap, M_TEMP);
return (error);
}
diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c
index aa362cb8a3ca..123f6529b6f2 100644
--- a/sys/kern/uipc_mqueue.c
+++ b/sys/kern/uipc_mqueue.c
@@ -1545,7 +1545,7 @@ mqueue_free(struct mqueue *mq)
while ((msg = TAILQ_FIRST(&mq->mq_msgq)) != NULL) {
TAILQ_REMOVE(&mq->mq_msgq, msg, msg_link);
- FREE(msg, M_MQUEUEDATA);
+ free(msg, M_MQUEUEDATA);
}
mtx_destroy(&mq->mq_mutex);
@@ -1566,11 +1566,11 @@ mqueue_loadmsg(const char *msg_ptr, size_t msg_size, int msg_prio)
int error;
len = sizeof(struct mqueue_msg) + msg_size;
- MALLOC(msg, struct mqueue_msg *, len, M_MQUEUEDATA, M_WAITOK);
+ msg = malloc(len, M_MQUEUEDATA, M_WAITOK);
error = copyin(msg_ptr, ((char *)msg) + sizeof(struct mqueue_msg),
msg_size);
if (error) {
- FREE(msg, M_MQUEUEDATA);
+ free(msg, M_MQUEUEDATA);
msg = NULL;
} else {
msg->msg_size = msg_size;
@@ -1600,7 +1600,7 @@ mqueue_savemsg(struct mqueue_msg *msg, char *msg_ptr, int *msg_prio)
static __inline void
mqueue_freemsg(struct mqueue_msg *msg)
{
- FREE(msg, M_MQUEUEDATA);
+ free(msg, M_MQUEUEDATA);
}
/*
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 994605b6eea0..2233e6540e39 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -457,7 +457,7 @@ kern_accept(struct thread *td, int s, struct sockaddr **name,
}
noconnection:
if (sa)
- FREE(sa, M_SONAME);
+ free(sa, M_SONAME);
/*
* close the new descriptor, assuming someone hasn't ripped it
@@ -720,7 +720,7 @@ sendit(td, s, mp, flags)
bad:
if (to)
- FREE(to, M_SONAME);
+ free(to, M_SONAME);
return (error);
}
@@ -1068,7 +1068,7 @@ out:
ktrsockaddr(fromsa);
#endif
if (fromsa)
- FREE(fromsa, M_SONAME);
+ free(fromsa, M_SONAME);
if (error == 0 && controlp != NULL)
*controlp = control;
@@ -1661,10 +1661,10 @@ getsockaddr(namp, uaddr, len)
return (ENAMETOOLONG);
if (len < offsetof(struct sockaddr, sa_data[0]))
return (EINVAL);
- MALLOC(sa, struct sockaddr *, len, M_SONAME, M_WAITOK);
+ sa = malloc(len, M_SONAME, M_WAITOK);
error = copyin(uaddr, sa, len);
if (error) {
- FREE(sa, M_SONAME);
+ free(sa, M_SONAME);
} else {
#if defined(COMPAT_OLDSOCK) && BYTE_ORDER != BIG_ENDIAN
if (sa->sa_family == 0 && sa->sa_len < AF_MAX)
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 7ecd7ca7bb12..2e27bd4994bf 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -600,7 +600,7 @@ uipc_detach(struct socket *so)
unp->unp_refcount--;
freeunp = (unp->unp_refcount == 0);
if (saved_unp_addr != NULL)
- FREE(saved_unp_addr, M_SONAME);
+ free(saved_unp_addr, M_SONAME);
if (freeunp) {
UNP_PCB_LOCK_DESTROY(unp);
uma_zfree(unp_zone, unp);
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c
index 439e84f748ad..775ed26686c9 100644
--- a/sys/kern/vfs_export.c
+++ b/sys/kern/vfs_export.c
@@ -330,7 +330,7 @@ vfs_setpublicfs(struct mount *mp, struct netexport *nep,
if (nfs_pub.np_valid) {
nfs_pub.np_valid = 0;
if (nfs_pub.np_index != NULL) {
- FREE(nfs_pub.np_index, M_TEMP);
+ free(nfs_pub.np_index, M_TEMP);
nfs_pub.np_index = NULL;
}
}
@@ -361,7 +361,7 @@ vfs_setpublicfs(struct mount *mp, struct netexport *nep,
* If an indexfile was specified, pull it in.
*/
if (argp->ex_indexfile != NULL) {
- MALLOC(nfs_pub.np_index, char *, MAXNAMLEN + 1, M_TEMP,
+ nfs_pub.np_index = malloc(MAXNAMLEN + 1, M_TEMP,
M_WAITOK);
error = copyinstr(argp->ex_indexfile, nfs_pub.np_index,
MAXNAMLEN, (size_t *)0);
@@ -377,7 +377,7 @@ vfs_setpublicfs(struct mount *mp, struct netexport *nep,
}
}
if (error) {
- FREE(nfs_pub.np_index, M_TEMP);
+ free(nfs_pub.np_index, M_TEMP);
return (error);
}
}
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 94c9422cf61c..22c880ad5d63 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -3928,7 +3928,7 @@ unionread:
kuio.uio_iov = &kiov;
kuio.uio_segflg = UIO_SYSSPACE;
kiov.iov_len = uap->count;
- MALLOC(dirbuf, caddr_t, uap->count, M_TEMP, M_WAITOK);
+ dirbuf = malloc(uap->count, M_TEMP, M_WAITOK);
kiov.iov_base = dirbuf;
error = VOP_READDIR(vp, &kuio, fp->f_cred, &eofflag,
NULL, NULL);
@@ -3965,7 +3965,7 @@ unionread:
if (dp >= edp)
error = uiomove(dirbuf, readcnt, &auio);
}
- FREE(dirbuf, M_TEMP);
+ free(dirbuf, M_TEMP);
}
if (error) {
VOP_UNLOCK(vp, 0);
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index da5a98f9ea5f..6eb58f7553f2 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -619,7 +619,7 @@ bpfopen(struct cdev *dev, int flags, int fmt, struct thread *td)
struct bpf_d *d;
int error;
- MALLOC(d, struct bpf_d *, sizeof(*d), M_BPF, M_WAITOK | M_ZERO);
+ d = malloc(sizeof(*d), M_BPF, M_WAITOK | M_ZERO);
error = devfs_set_cdevpriv(d, bpf_dtor);
if (error != 0) {
free(d, M_BPF);
diff --git a/sys/net/bsd_comp.c b/sys/net/bsd_comp.c
index 3506196afff2..462567b79865 100644
--- a/sys/net/bsd_comp.c
+++ b/sys/net/bsd_comp.c
@@ -346,7 +346,7 @@ bsd_alloc(options, opt_len, decomp)
maxmaxcode = MAXCODE(bits);
newlen = sizeof(*db) + (hsize-1) * (sizeof(db->dict[0]));
- MALLOC(db, struct bsd_db *, newlen, M_DEVBUF, M_NOWAIT);
+ db = malloc(newlen, M_DEVBUF, M_NOWAIT);
if (!db)
return NULL;
bzero(db, sizeof(*db) - sizeof(db->dict));
@@ -354,7 +354,7 @@ bsd_alloc(options, opt_len, decomp)
if (!decomp) {
db->lens = NULL;
} else {
- MALLOC(db->lens, u_int16_t *, (maxmaxcode+1) * sizeof(db->lens[0]),
+ db->lens = malloc((maxmaxcode+1) * sizeof(db->lens[0]),
M_DEVBUF, M_NOWAIT);
if (!db->lens) {
free(db, M_DEVBUF);
diff --git a/sys/net/if.c b/sys/net/if.c
index 7bf1ecb8b7ae..e8e00e04dcd5 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -2299,14 +2299,14 @@ if_allocmulti(struct ifnet *ifp, struct sockaddr *sa, struct sockaddr *llsa,
struct ifmultiaddr *ifma;
struct sockaddr *dupsa;
- MALLOC(ifma, struct ifmultiaddr *, sizeof *ifma, M_IFMADDR, mflags |
+ ifma = malloc(sizeof *ifma, M_IFMADDR, mflags |
M_ZERO);
if (ifma == NULL)
return (NULL);
- MALLOC(dupsa, struct sockaddr *, sa->sa_len, M_IFMADDR, mflags);
+ dupsa = malloc(sa->sa_len, M_IFMADDR, mflags);
if (dupsa == NULL) {
- FREE(ifma, M_IFMADDR);
+ free(ifma, M_IFMADDR);
return (NULL);
}
bcopy(sa, dupsa, sa->sa_len);
@@ -2321,10 +2321,10 @@ if_allocmulti(struct ifnet *ifp, struct sockaddr *sa, struct sockaddr *llsa,
return (ifma);
}
- MALLOC(dupsa, struct sockaddr *, llsa->sa_len, M_IFMADDR, mflags);
+ dupsa = malloc(llsa->sa_len, M_IFMADDR, mflags);
if (dupsa == NULL) {
- FREE(ifma->ifma_addr, M_IFMADDR);
- FREE(ifma, M_IFMADDR);
+ free(ifma->ifma_addr, M_IFMADDR);
+ free(ifma, M_IFMADDR);
return (NULL);
}
bcopy(llsa, dupsa, llsa->sa_len);
@@ -2349,9 +2349,9 @@ if_freemulti(struct ifmultiaddr *ifma)
("if_freemulti: protospec not NULL"));
if (ifma->ifma_lladdr != NULL)
- FREE(ifma->ifma_lladdr, M_IFMADDR);
- FREE(ifma->ifma_addr, M_IFMADDR);
- FREE(ifma, M_IFMADDR);
+ free(ifma->ifma_lladdr, M_IFMADDR);
+ free(ifma->ifma_addr, M_IFMADDR);
+ free(ifma, M_IFMADDR);
}
/*
@@ -2469,13 +2469,13 @@ if_addmulti(struct ifnet *ifp, struct sockaddr *sa,
}
if (llsa != NULL)
- FREE(llsa, M_IFMADDR);
+ free(llsa, M_IFMADDR);
return (0);
free_llsa_out:
if (llsa != NULL)
- FREE(llsa, M_IFMADDR);
+ free(llsa, M_IFMADDR);
unlock_out:
IF_ADDR_UNLOCK(ifp);
diff --git a/sys/net/if_arcsubr.c b/sys/net/if_arcsubr.c
index 30fb47eb33e8..578549e7b66a 100644
--- a/sys/net/if_arcsubr.c
+++ b/sys/net/if_arcsubr.c
@@ -778,7 +778,7 @@ arc_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa,
sin = (struct sockaddr_in *)sa;
if (!IN_MULTICAST(ntohl(sin->sin_addr.s_addr)))
return EADDRNOTAVAIL;
- MALLOC(sdl, struct sockaddr_dl *, sizeof *sdl, M_IFMADDR,
+ sdl = malloc(sizeof *sdl, M_IFMADDR,
M_NOWAIT | M_ZERO);
if (sdl == NULL)
return ENOMEM;
@@ -806,7 +806,7 @@ arc_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa,
}
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
return EADDRNOTAVAIL;
- MALLOC(sdl, struct sockaddr_dl *, sizeof *sdl, M_IFMADDR,
+ sdl = malloc(sizeof *sdl, M_IFMADDR,
M_NOWAIT | M_ZERO);
if (sdl == NULL)
return ENOMEM;
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index c51b3317e7f4..0365d1be3672 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1124,7 +1124,7 @@ ether_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa,
sin = (struct sockaddr_in *)sa;
if (!IN_MULTICAST(ntohl(sin->sin_addr.s_addr)))
return EADDRNOTAVAIL;
- MALLOC(sdl, struct sockaddr_dl *, sizeof *sdl, M_IFMADDR,
+ sdl = malloc(sizeof *sdl, M_IFMADDR,
M_NOWAIT|M_ZERO);
if (sdl == NULL)
return ENOMEM;
@@ -1153,7 +1153,7 @@ ether_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa,
}
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
return EADDRNOTAVAIL;
- MALLOC(sdl, struct sockaddr_dl *, sizeof *sdl, M_IFMADDR,
+ sdl = malloc(sizeof *sdl, M_IFMADDR,
M_NOWAIT|M_ZERO);
if (sdl == NULL)
return (ENOMEM);
diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c
index c4e7b624395e..a8eab74fa016 100644
--- a/sys/net/if_fddisubr.c
+++ b/sys/net/if_fddisubr.c
@@ -718,7 +718,7 @@ fddi_resolvemulti(ifp, llsa, sa)
sin = (struct sockaddr_in *)sa;
if (!IN_MULTICAST(ntohl(sin->sin_addr.s_addr)))
return (EADDRNOTAVAIL);
- MALLOC(sdl, struct sockaddr_dl *, sizeof *sdl, M_IFMADDR,
+ sdl = malloc(sizeof *sdl, M_IFMADDR,
M_NOWAIT | M_ZERO);
if (sdl == NULL)
return (ENOMEM);
@@ -749,7 +749,7 @@ fddi_resolvemulti(ifp, llsa, sa)
}
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
return (EADDRNOTAVAIL);
- MALLOC(sdl, struct sockaddr_dl *, sizeof *sdl, M_IFMADDR,
+ sdl = malloc(sizeof *sdl, M_IFMADDR,
M_NOWAIT | M_ZERO);
if (sdl == NULL)
return (ENOMEM);
diff --git a/sys/net/if_iso88025subr.c b/sys/net/if_iso88025subr.c
index dd50923295b8..0c915c96b161 100644
--- a/sys/net/if_iso88025subr.c
+++ b/sys/net/if_iso88025subr.c
@@ -720,7 +720,7 @@ iso88025_resolvemulti (ifp, llsa, sa)
if (!IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) {
return (EADDRNOTAVAIL);
}
- MALLOC(sdl, struct sockaddr_dl *, sizeof *sdl, M_IFMADDR,
+ sdl = malloc(sizeof *sdl, M_IFMADDR,
M_NOWAIT|M_ZERO);
if (sdl == NULL)
return (ENOMEM);
@@ -750,7 +750,7 @@ iso88025_resolvemulti (ifp, llsa, sa)
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) {
return (EADDRNOTAVAIL);
}
- MALLOC(sdl, struct sockaddr_dl *, sizeof *sdl, M_IFMADDR,
+ sdl = malloc(sizeof *sdl, M_IFMADDR,
M_NOWAIT|M_ZERO);
if (sdl == NULL)
return (ENOMEM);
diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c
index a24cd81c0f71..753adf926bec 100644
--- a/sys/net/if_ppp.c
+++ b/sys/net/if_ppp.c
@@ -348,7 +348,7 @@ pppalloc(pid)
sc->sc_relinq = NULL;
bzero((char *)&sc->sc_stats, sizeof(sc->sc_stats));
#ifdef VJC
- MALLOC(sc->sc_comp, struct slcompress *, sizeof(struct slcompress),
+ sc->sc_comp = malloc(sizeof(struct slcompress),
M_DEVBUF, M_NOWAIT);
if (sc->sc_comp)
sl_compress_init(sc->sc_comp, -1);
@@ -614,7 +614,7 @@ pppioctl(sc, cmd, data, flag, td)
}
newcodelen = nbp->bf_len * sizeof(struct bpf_insn);
if (newcodelen != 0) {
- MALLOC(newcode, struct bpf_insn *, newcodelen, M_DEVBUF, M_WAITOK);
+ newcode = malloc(newcodelen, M_DEVBUF, M_WAITOK);
if (newcode == 0) {
error = EINVAL; /* or sumpin */
break;
diff --git a/sys/net/if_sl.c b/sys/net/if_sl.c
index 801d3a74a013..f5bf5330208b 100644
--- a/sys/net/if_sl.c
+++ b/sys/net/if_sl.c
@@ -271,7 +271,7 @@ slmarkstatic(int unit)
if (slisstatic(unit))
return;
- MALLOC(t, int *, sizeof(int) * (st_unit_max+1), M_SL, M_NOWAIT);
+ t = malloc(sizeof(int) * (st_unit_max+1), M_SL, M_NOWAIT);
if (t == NULL)
return;
@@ -291,7 +291,7 @@ slcreate(void)
int unit;
struct mbuf *m;
- MALLOC(sc, struct sl_softc *, sizeof(*sc), M_SL, M_WAITOK | M_ZERO);
+ sc = malloc(sizeof(*sc), M_SL, M_WAITOK | M_ZERO);
sc->sc_ifp = if_alloc(IFT_SLIP);
if (sc->sc_ifp == NULL) {
free(sc, M_SL);
@@ -664,8 +664,7 @@ sltstart(struct tty *tp)
register u_char *cp;
if (sc->bpfbuf == NULL)
- MALLOC(sc->bpfbuf, u_char *,
- SLTMAX + SLIP_HDRLEN, M_SL, M_NOWAIT);
+ sc->bpfbuf = malloc( SLTMAX + SLIP_HDRLEN, M_SL, M_NOWAIT);
if (sc->bpfbuf) {
cp = sc->bpfbuf + SLIP_HDRLEN;
diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c
index 6dfc8c981a79..b4ee7e1c2447 100644
--- a/sys/net/if_tap.c
+++ b/sys/net/if_tap.c
@@ -412,7 +412,7 @@ tapcreate(struct cdev *dev)
dev->si_flags &= ~SI_CHEAPCLONE;
/* allocate driver storage and create device */
- MALLOC(tp, struct tap_softc *, sizeof(*tp), M_TAP, M_WAITOK | M_ZERO);
+ tp = malloc(sizeof(*tp), M_TAP, M_WAITOK | M_ZERO);
mtx_init(&tp->tap_mtx, "tap_mtx", NULL, MTX_DEF);
mtx_lock(&tapmtx);
SLIST_INSERT_HEAD(&taphead, tp, tap_next);
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index a1ec49524531..50006f080608 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -363,7 +363,7 @@ tuncreate(const char *name, struct cdev *dev)
dev->si_flags &= ~SI_CHEAPCLONE;
- MALLOC(sc, struct tun_softc *, sizeof(*sc), M_TUN, M_WAITOK | M_ZERO);
+ sc = malloc(sizeof(*sc), M_TUN, M_WAITOK | M_ZERO);
mtx_init(&sc->tun_mtx, "tun_mtx", NULL, MTX_DEF);
sc->tun_flags = TUN_INITED;
sc->tun_dev = dev;
diff --git a/sys/net/ppp_deflate.c b/sys/net/ppp_deflate.c
index 0bf0c495ef5c..e3015bdf3728 100644
--- a/sys/net/ppp_deflate.c
+++ b/sys/net/ppp_deflate.c
@@ -126,7 +126,7 @@ z_alloc(notused, items, size)
{
void *ptr;
- MALLOC(ptr, void *, items * size, M_DEVBUF, M_NOWAIT);
+ ptr = malloc(items * size, M_DEVBUF, M_NOWAIT);
return ptr;
}
@@ -159,7 +159,7 @@ z_comp_alloc(options, opt_len)
if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE)
return NULL;
- MALLOC(state, struct deflate_state *, sizeof(struct deflate_state),
+ state = malloc(sizeof(struct deflate_state),
M_DEVBUF, M_NOWAIT);
if (state == NULL)
return NULL;
@@ -389,7 +389,7 @@ z_decomp_alloc(options, opt_len)
if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE)
return NULL;
- MALLOC(state, struct deflate_state *, sizeof(struct deflate_state),
+ state = malloc(sizeof(struct deflate_state),
M_DEVBUF, M_NOWAIT);
if (state == NULL)
return NULL;
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 7b610d678335..ae6fa6a5180f 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -169,7 +169,7 @@ rts_attach(struct socket *so, int proto, struct thread *td)
KASSERT(so->so_pcb == NULL, ("rts_attach: so_pcb != NULL"));
/* XXX */
- MALLOC(rp, struct rawcb *, sizeof *rp, M_PCB, M_WAITOK | M_ZERO);
+ rp = malloc(sizeof *rp, M_PCB, M_WAITOK | M_ZERO);
if (rp == NULL)
return ENOBUFS;
diff --git a/sys/net80211/ieee80211_acl.c b/sys/net80211/ieee80211_acl.c
index 13407a4a1b39..b63883402e17 100644
--- a/sys/net80211/ieee80211_acl.c
+++ b/sys/net80211/ieee80211_acl.c
@@ -99,7 +99,7 @@ acl_attach(struct ieee80211vap *vap)
{
struct aclstate *as;
- MALLOC(as, struct aclstate *, sizeof(struct aclstate),
+ as = malloc(sizeof(struct aclstate),
M_80211_ACL, M_NOWAIT | M_ZERO);
if (as == NULL)
return 0;
@@ -123,7 +123,7 @@ acl_detach(struct ieee80211vap *vap)
acl_free_all(vap);
vap->iv_as = NULL;
ACL_LOCK_DESTROY(as);
- FREE(as, M_80211_ACL);
+ free(as, M_80211_ACL);
}
static __inline struct acl *
@@ -147,7 +147,7 @@ _acl_free(struct aclstate *as, struct acl *acl)
TAILQ_REMOVE(&as->as_list, acl, acl_list);
LIST_REMOVE(acl, acl_hash);
- FREE(acl, M_80211_ACL);
+ free(acl, M_80211_ACL);
as->as_nacls--;
}
@@ -175,7 +175,7 @@ acl_add(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN])
struct acl *acl, *new;
int hash;
- MALLOC(new, struct acl *, sizeof(struct acl), M_80211_ACL, M_NOWAIT | M_ZERO);
+ new = malloc(sizeof(struct acl), M_80211_ACL, M_NOWAIT | M_ZERO);
if (new == NULL) {
IEEE80211_DPRINTF(vap, IEEE80211_MSG_ACL,
"ACL: add %s failed, no memory\n", ether_sprintf(mac));
@@ -188,7 +188,7 @@ acl_add(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN])
LIST_FOREACH(acl, &as->as_hash[hash], acl_hash) {
if (IEEE80211_ADDR_EQ(acl->acl_macaddr, mac)) {
ACL_UNLOCK(as);
- FREE(new, M_80211_ACL);
+ free(new, M_80211_ACL);
IEEE80211_DPRINTF(vap, IEEE80211_MSG_ACL,
"ACL: add %s failed, already present\n",
ether_sprintf(mac));
@@ -301,7 +301,7 @@ acl_getioctl(struct ieee80211vap *vap, struct ieee80211req *ireq)
ireq->i_len = space; /* return required space */
return 0; /* NB: must not error */
}
- MALLOC(ap, struct ieee80211req_maclist *, space,
+ ap = malloc(space,
M_TEMP, M_NOWAIT);
if (ap == NULL)
return ENOMEM;
@@ -317,7 +317,7 @@ acl_getioctl(struct ieee80211vap *vap, struct ieee80211req *ireq)
ireq->i_len = space;
} else
error = copyout(ap, ireq->i_data, ireq->i_len);
- FREE(ap, M_TEMP);
+ free(ap, M_TEMP);
return error;
}
return EINVAL;
diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c
index bdaf7e390534..67679f50a3e5 100644
--- a/sys/net80211/ieee80211_crypto_ccmp.c
+++ b/sys/net80211/ieee80211_crypto_ccmp.c
@@ -96,7 +96,7 @@ ccmp_attach(struct ieee80211vap *vap, struct ieee80211_key *k)
{
struct ccmp_ctx *ctx;
- MALLOC(ctx, struct ccmp_ctx *, sizeof(struct ccmp_ctx),
+ ctx = malloc(sizeof(struct ccmp_ctx),
M_80211_CRYPTO, M_NOWAIT | M_ZERO);
if (ctx == NULL) {
vap->iv_stats.is_crypto_nomem++;
@@ -113,7 +113,7 @@ ccmp_detach(struct ieee80211_key *k)
{
struct ccmp_ctx *ctx = k->wk_private;
- FREE(ctx, M_80211_CRYPTO);
+ free(ctx, M_80211_CRYPTO);
KASSERT(nrefs > 0, ("imbalanced attach/detach"));
nrefs--; /* NB: we assume caller locking */
}
diff --git a/sys/net80211/ieee80211_crypto_tkip.c b/sys/net80211/ieee80211_crypto_tkip.c
index f509856ac9c5..744b643f5ff2 100644
--- a/sys/net80211/ieee80211_crypto_tkip.c
+++ b/sys/net80211/ieee80211_crypto_tkip.c
@@ -109,7 +109,7 @@ tkip_attach(struct ieee80211vap *vap, struct ieee80211_key *k)
{
struct tkip_ctx *ctx;
- MALLOC(ctx, struct tkip_ctx *, sizeof(struct tkip_ctx),
+ ctx = malloc(sizeof(struct tkip_ctx),
M_80211_CRYPTO, M_NOWAIT | M_ZERO);
if (ctx == NULL) {
vap->iv_stats.is_crypto_nomem++;
@@ -126,7 +126,7 @@ tkip_detach(struct ieee80211_key *k)
{
struct tkip_ctx *ctx = k->wk_private;
- FREE(ctx, M_80211_CRYPTO);
+ free(ctx, M_80211_CRYPTO);
KASSERT(nrefs > 0, ("imbalanced attach/detach"));
nrefs--; /* NB: we assume caller locking */
}
diff --git a/sys/net80211/ieee80211_crypto_wep.c b/sys/net80211/ieee80211_crypto_wep.c
index 7eade597bf06..dc31e0bbf1ae 100644
--- a/sys/net80211/ieee80211_crypto_wep.c
+++ b/sys/net80211/ieee80211_crypto_wep.c
@@ -87,7 +87,7 @@ wep_attach(struct ieee80211vap *vap, struct ieee80211_key *k)
{
struct wep_ctx *ctx;
- MALLOC(ctx, struct wep_ctx *, sizeof(struct wep_ctx),
+ ctx = malloc(sizeof(struct wep_ctx),
M_80211_CRYPTO, M_NOWAIT | M_ZERO);
if (ctx == NULL) {
vap->iv_stats.is_crypto_nomem++;
@@ -106,7 +106,7 @@ wep_detach(struct ieee80211_key *k)
{
struct wep_ctx *ctx = k->wk_private;
- FREE(ctx, M_80211_CRYPTO);
+ free(ctx, M_80211_CRYPTO);
KASSERT(nrefs > 0, ("imbalanced attach/detach"));
nrefs--; /* NB: we assume caller locking */
}
diff --git a/sys/net80211/ieee80211_freebsd.c b/sys/net80211/ieee80211_freebsd.c
index 71174b72edfc..8ca01978b584 100644
--- a/sys/net80211/ieee80211_freebsd.c
+++ b/sys/net80211/ieee80211_freebsd.c
@@ -234,7 +234,7 @@ ieee80211_sysctl_vattach(struct ieee80211vap *vap)
struct sysctl_oid *oid;
char num[14]; /* sufficient for 32 bits */
- MALLOC(ctx, struct sysctl_ctx_list *, sizeof(struct sysctl_ctx_list),
+ ctx = malloc(sizeof(struct sysctl_ctx_list),
M_DEVBUF, M_NOWAIT | M_ZERO);
if (ctx == NULL) {
if_printf(ifp, "%s: cannot allocate sysctl context!\n",
@@ -310,7 +310,7 @@ ieee80211_sysctl_vdetach(struct ieee80211vap *vap)
if (vap->iv_sysctl != NULL) {
sysctl_ctx_free(vap->iv_sysctl);
- FREE(vap->iv_sysctl, M_DEVBUF);
+ free(vap->iv_sysctl, M_DEVBUF);
vap->iv_sysctl = NULL;
}
}
diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c
index c0a99a12dbf4..37d2c2fbe2f3 100644
--- a/sys/net80211/ieee80211_hostap.c
+++ b/sys/net80211/ieee80211_hostap.c
@@ -902,7 +902,7 @@ hostap_auth_open(struct ieee80211_node *ni, struct ieee80211_frame *wh,
* open auth is attempted.
*/
if (ni->ni_challenge != NULL) {
- FREE(ni->ni_challenge, M_80211_NODE);
+ free(ni->ni_challenge, M_80211_NODE);
ni->ni_challenge = NULL;
}
/* XXX hack to workaround calling convention */
@@ -1986,7 +1986,7 @@ hostap_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
return;
/* discard challenge after association */
if (ni->ni_challenge != NULL) {
- FREE(ni->ni_challenge, M_80211_NODE);
+ free(ni->ni_challenge, M_80211_NODE);
ni->ni_challenge = NULL;
}
/* NB: 802.11 spec says to ignore station's privacy bit */
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
index 67bcd43a4d88..4a83111c177a 100644
--- a/sys/net80211/ieee80211_input.c
+++ b/sys/net80211/ieee80211_input.c
@@ -499,7 +499,7 @@ int
ieee80211_alloc_challenge(struct ieee80211_node *ni)
{
if (ni->ni_challenge == NULL)
- MALLOC(ni->ni_challenge, uint32_t*, IEEE80211_CHALLENGE_LEN,
+ ni->ni_challenge = malloc(IEEE80211_CHALLENGE_LEN,
M_80211_NODE, M_NOWAIT);
if (ni->ni_challenge == NULL) {
IEEE80211_NOTE(ni->ni_vap,
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c
index cab8b33e4277..c9f4995bf1ba 100644
--- a/sys/net80211/ieee80211_ioctl.c
+++ b/sys/net80211/ieee80211_ioctl.c
@@ -320,14 +320,14 @@ ieee80211_ioctl_getscanresults(struct ieee80211vap *vap,
space = req.space;
/* XXX M_WAITOK after driver lock released */
- MALLOC(p, void *, space, M_TEMP, M_NOWAIT | M_ZERO);
+ p = malloc(space, M_TEMP, M_NOWAIT | M_ZERO);
if (p == NULL)
return ENOMEM;
req.sr = p;
ieee80211_scan_iterate(vap, get_scan_result, &req);
ireq->i_len = space - req.space;
error = copyout(p, ireq->i_data, ireq->i_len);
- FREE(p, M_TEMP);
+ free(p, M_TEMP);
} else
ireq->i_len = 0;
@@ -467,7 +467,7 @@ getstainfo_common(struct ieee80211vap *vap, struct ieee80211req *ireq,
if (req.space > 0) {
space = req.space;
/* XXX M_WAITOK after driver lock released */
- MALLOC(p, void *, space, M_TEMP, M_NOWAIT | M_ZERO);
+ p = malloc(space, M_TEMP, M_NOWAIT | M_ZERO);
if (p == NULL) {
error = ENOMEM;
goto bad;
@@ -479,7 +479,7 @@ getstainfo_common(struct ieee80211vap *vap, struct ieee80211req *ireq,
get_sta_info(&req, ni);
ireq->i_len = space - req.space;
error = copyout(p, (uint8_t *) ireq->i_data+off, ireq->i_len);
- FREE(p, M_TEMP);
+ free(p, M_TEMP);
} else
ireq->i_len = 0;
bad:
@@ -696,8 +696,7 @@ ieee80211_ioctl_getdevcaps(struct ieee80211com *ic,
if (ireq->i_len != sizeof(struct ieee80211_devcaps_req))
return EINVAL;
- MALLOC(dc, struct ieee80211_devcaps_req *,
- sizeof(struct ieee80211_devcaps_req), M_TEMP, M_NOWAIT | M_ZERO);
+ dc = malloc( sizeof(struct ieee80211_devcaps_req), M_TEMP, M_NOWAIT | M_ZERO);
if (dc == NULL)
return ENOMEM;
dc->dc_drivercaps = ic->ic_caps;
@@ -707,7 +706,7 @@ ieee80211_ioctl_getdevcaps(struct ieee80211com *ic,
ic->ic_getradiocaps(ic, &ci->ic_nchans, ci->ic_chans);
ieee80211_sort_channels(ci->ic_chans, ci->ic_nchans);
error = copyout(dc, ireq->i_data, sizeof(*dc));
- FREE(dc, M_TEMP);
+ free(dc, M_TEMP);
return error;
}
@@ -1993,14 +1992,13 @@ ieee80211_ioctl_setregdomain(struct ieee80211vap *vap,
if (ireq->i_len != sizeof(struct ieee80211_regdomain_req))
return EINVAL;
- MALLOC(reg, struct ieee80211_regdomain_req *,
- sizeof(struct ieee80211_regdomain_req), M_TEMP, M_NOWAIT);
+ reg = malloc( sizeof(struct ieee80211_regdomain_req), M_TEMP, M_NOWAIT);
if (reg == NULL)
return ENOMEM;
error = copyin(ireq->i_data, reg, sizeof(*reg));
if (error == 0)
error = ieee80211_setregdomain(vap, reg);
- FREE(reg, M_TEMP);
+ free(reg, M_TEMP);
return (error == 0 ? ENETRESET : error);
}
@@ -2139,7 +2137,7 @@ setappie(struct ieee80211_appie **aie, const struct ieee80211req *ireq)
if (ireq->i_len == 0) { /* delete any existing ie */
if (app != NULL) {
*aie = NULL; /* XXX racey */
- FREE(app, M_80211_NODE_IE);
+ free(app, M_80211_NODE_IE);
}
return 0;
}
@@ -2153,20 +2151,19 @@ setappie(struct ieee80211_appie **aie, const struct ieee80211req *ireq)
*
* XXX bad bad bad
*/
- MALLOC(napp, struct ieee80211_appie *,
- sizeof(struct ieee80211_appie) + ireq->i_len, M_80211_NODE_IE, M_NOWAIT);
+ napp = malloc( sizeof(struct ieee80211_appie) + ireq->i_len, M_80211_NODE_IE, M_NOWAIT);
if (napp == NULL)
return ENOMEM;
/* XXX holding ic lock */
error = copyin(ireq->i_data, napp->ie_data, ireq->i_len);
if (error) {
- FREE(napp, M_80211_NODE_IE);
+ free(napp, M_80211_NODE_IE);
return error;
}
napp->ie_len = ireq->i_len;
*aie = napp;
if (app != NULL)
- FREE(app, M_80211_NODE_IE);
+ free(app, M_80211_NODE_IE);
return 0;
}
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index f7aa3a94de1a..bfdc64b84e2f 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -148,8 +148,7 @@ ieee80211_node_latevattach(struct ieee80211vap *vap)
"WARNING: max aid too small, changed to %d\n",
vap->iv_max_aid);
}
- MALLOC(vap->iv_aid_bitmap, uint32_t *,
- howmany(vap->iv_max_aid, 32) * sizeof(uint32_t),
+ vap->iv_aid_bitmap = malloc( howmany(vap->iv_max_aid, 32) * sizeof(uint32_t),
M_80211_NODE, M_NOWAIT | M_ZERO);
if (vap->iv_aid_bitmap == NULL) {
/* XXX no way to recover */
@@ -175,7 +174,7 @@ ieee80211_node_vdetach(struct ieee80211vap *vap)
vap->iv_bss = NULL;
}
if (vap->iv_aid_bitmap != NULL) {
- FREE(vap->iv_aid_bitmap, M_80211_NODE);
+ free(vap->iv_aid_bitmap, M_80211_NODE);
vap->iv_aid_bitmap = NULL;
}
}
@@ -769,7 +768,7 @@ node_alloc(struct ieee80211vap *vap, const uint8_t macaddr[IEEE80211_ADDR_LEN])
{
struct ieee80211_node *ni;
- MALLOC(ni, struct ieee80211_node *, sizeof(struct ieee80211_node),
+ ni = malloc(sizeof(struct ieee80211_node),
M_80211_NODE, M_NOWAIT | M_ZERO);
return ni;
}
@@ -787,11 +786,11 @@ ieee80211_ies_init(struct ieee80211_ies *ies, const uint8_t *data, int len)
memset(ies, 0, offsetof(struct ieee80211_ies, data));
if (ies->data != NULL && ies->len != len) {
/* data size changed */
- FREE(ies->data, M_80211_NODE_IE);
+ free(ies->data, M_80211_NODE_IE);
ies->data = NULL;
}
if (ies->data == NULL) {
- MALLOC(ies->data, uint8_t *, len, M_80211_NODE_IE, M_NOWAIT);
+ ies->data = malloc(len, M_80211_NODE_IE, M_NOWAIT);
if (ies->data == NULL) {
ies->len = 0;
/* NB: pointers have already been zero'd above */
@@ -810,7 +809,7 @@ void
ieee80211_ies_cleanup(struct ieee80211_ies *ies)
{
if (ies->data != NULL)
- FREE(ies->data, M_80211_NODE_IE);
+ free(ies->data, M_80211_NODE_IE);
}
/*
@@ -890,7 +889,7 @@ node_cleanup(struct ieee80211_node *ni)
ni->ni_associd = 0;
if (ni->ni_challenge != NULL) {
- FREE(ni->ni_challenge, M_80211_NODE);
+ free(ni->ni_challenge, M_80211_NODE);
ni->ni_challenge = NULL;
}
/*
@@ -926,7 +925,7 @@ node_free(struct ieee80211_node *ni)
ieee80211_ies_cleanup(&ni->ni_ies);
IEEE80211_NODE_SAVEQ_DESTROY(ni);
IEEE80211_NODE_WDSQ_DESTROY(ni);
- FREE(ni, M_80211_NODE);
+ free(ni, M_80211_NODE);
}
static void
@@ -1778,8 +1777,7 @@ ieee80211_node_table_init(struct ieee80211com *ic,
nt->nt_inact_init = inact;
nt->nt_keyixmax = keyixmax;
if (nt->nt_keyixmax > 0) {
- MALLOC(nt->nt_keyixmap, struct ieee80211_node **,
- keyixmax * sizeof(struct ieee80211_node *),
+ nt->nt_keyixmap = malloc( keyixmax * sizeof(struct ieee80211_node *),
M_80211_NODE, M_NOWAIT | M_ZERO);
if (nt->nt_keyixmap == NULL)
if_printf(ic->ic_ifp,
@@ -1839,7 +1837,7 @@ ieee80211_node_table_cleanup(struct ieee80211_node_table *nt)
printf("%s: %s[%u] still active\n", __func__,
nt->nt_name, i);
#endif
- FREE(nt->nt_keyixmap, M_80211_NODE);
+ free(nt->nt_keyixmap, M_80211_NODE);
nt->nt_keyixmap = NULL;
}
IEEE80211_NODE_ITERATE_LOCK_DESTROY(nt);
diff --git a/sys/net80211/ieee80211_power.c b/sys/net80211/ieee80211_power.c
index 2a7dda88246a..debbd426d098 100644
--- a/sys/net80211/ieee80211_power.c
+++ b/sys/net80211/ieee80211_power.c
@@ -80,7 +80,7 @@ ieee80211_power_latevattach(struct ieee80211vap *vap)
*/
if (vap->iv_opmode == IEEE80211_M_HOSTAP) {
vap->iv_tim_len = howmany(vap->iv_max_aid,8) * sizeof(uint8_t);
- MALLOC(vap->iv_tim_bitmap, uint8_t *, vap->iv_tim_len,
+ vap->iv_tim_bitmap = malloc(vap->iv_tim_len,
M_80211_POWER, M_NOWAIT | M_ZERO);
if (vap->iv_tim_bitmap == NULL) {
printf("%s: no memory for TIM bitmap!\n", __func__);
@@ -94,7 +94,7 @@ void
ieee80211_power_vdetach(struct ieee80211vap *vap)
{
if (vap->iv_tim_bitmap != NULL) {
- FREE(vap->iv_tim_bitmap, M_80211_POWER);
+ free(vap->iv_tim_bitmap, M_80211_POWER);
vap->iv_tim_bitmap = NULL;
}
}
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c
index 452bd3f40cfb..31b68fdcdd7a 100644
--- a/sys/net80211/ieee80211_proto.c
+++ b/sys/net80211/ieee80211_proto.c
@@ -214,7 +214,7 @@ ieee80211_proto_vdetach(struct ieee80211vap *vap)
{
#define FREEAPPIE(ie) do { \
if (ie != NULL) \
- FREE(ie, M_80211_NODE_IE); \
+ free(ie, M_80211_NODE_IE); \
} while (0)
/*
* Detach operating mode module.
diff --git a/sys/net80211/ieee80211_scan.c b/sys/net80211/ieee80211_scan.c
index dabb4049f9a3..7fe649b4b533 100644
--- a/sys/net80211/ieee80211_scan.c
+++ b/sys/net80211/ieee80211_scan.c
@@ -96,7 +96,7 @@ ieee80211_scan_attach(struct ieee80211com *ic)
{
struct scan_state *ss;
- MALLOC(ss, struct scan_state *, sizeof(struct scan_state),
+ ss = malloc(sizeof(struct scan_state),
M_80211_SCAN, M_NOWAIT | M_ZERO);
if (ss == NULL) {
ic->ic_scan = NULL;
@@ -122,7 +122,7 @@ ieee80211_scan_detach(struct ieee80211com *ic)
}
ic->ic_flags &= ~IEEE80211_F_SCAN;
ic->ic_scan = NULL;
- FREE(SCAN_PRIVATE(ss), M_80211_SCAN);
+ free(SCAN_PRIVATE(ss), M_80211_SCAN);
}
}
diff --git a/sys/net80211/ieee80211_scan_sta.c b/sys/net80211/ieee80211_scan_sta.c
index 6b5bf8899e62..1da40f6bf620 100644
--- a/sys/net80211/ieee80211_scan_sta.c
+++ b/sys/net80211/ieee80211_scan_sta.c
@@ -138,7 +138,7 @@ sta_attach(struct ieee80211_scan_state *ss)
{
struct sta_table *st;
- MALLOC(st, struct sta_table *, sizeof(struct sta_table),
+ st = malloc(sizeof(struct sta_table),
M_80211_SCAN, M_NOWAIT | M_ZERO);
if (st == NULL)
return 0;
@@ -162,7 +162,7 @@ sta_detach(struct ieee80211_scan_state *ss)
sta_flush_table(st);
mtx_destroy(&st->st_lock);
mtx_destroy(&st->st_scanlock);
- FREE(st, M_80211_SCAN);
+ free(st, M_80211_SCAN);
KASSERT(nrefs > 0, ("imbalanced attach/detach"));
nrefs--; /* NB: we assume caller locking */
}
@@ -196,7 +196,7 @@ sta_flush_table(struct sta_table *st)
TAILQ_REMOVE(&st->st_entry, se, se_list);
LIST_REMOVE(se, se_hash);
ieee80211_ies_cleanup(&se->base.se_ies);
- FREE(se, M_80211_SCAN);
+ free(se, M_80211_SCAN);
}
memset(st->st_maxrssi, 0, sizeof(st->st_maxrssi));
}
@@ -229,7 +229,7 @@ sta_add(struct ieee80211_scan_state *ss,
LIST_FOREACH(se, &st->st_hash[hash], se_hash)
if (IEEE80211_ADDR_EQ(se->base.se_macaddr, macaddr))
goto found;
- MALLOC(se, struct sta_entry *, sizeof(struct sta_entry),
+ se = malloc(sizeof(struct sta_entry),
M_80211_SCAN, M_NOWAIT | M_ZERO);
if (se == NULL) {
mtx_unlock(&st->st_lock);
@@ -1439,7 +1439,7 @@ adhoc_age(struct ieee80211_scan_state *ss)
TAILQ_REMOVE(&st->st_entry, se, se_list);
LIST_REMOVE(se, se_hash);
ieee80211_ies_cleanup(&se->base.se_ies);
- FREE(se, M_80211_SCAN);
+ free(se, M_80211_SCAN);
}
}
mtx_unlock(&st->st_lock);
diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c
index c50fa538243e..c00af2b7b3f7 100644
--- a/sys/net80211/ieee80211_sta.c
+++ b/sys/net80211/ieee80211_sta.c
@@ -1013,7 +1013,7 @@ sta_auth_shared(struct ieee80211_node *ni, struct ieee80211_frame *wh,
switch (seq) {
case IEEE80211_AUTH_SHARED_PASS:
if (ni->ni_challenge != NULL) {
- FREE(ni->ni_challenge, M_80211_NODE);
+ free(ni->ni_challenge, M_80211_NODE);
ni->ni_challenge = NULL;
}
if (status != 0) {
diff --git a/sys/netatalk/ddp_pcb.c b/sys/netatalk/ddp_pcb.c
index 068d427ebea6..e40c84b6c1d0 100644
--- a/sys/netatalk/ddp_pcb.c
+++ b/sys/netatalk/ddp_pcb.c
@@ -290,7 +290,7 @@ at_pcballoc(struct socket *so)
DDP_LIST_XLOCK_ASSERT();
- MALLOC(ddp, struct ddpcb *, sizeof *ddp, M_PCB, M_NOWAIT | M_ZERO);
+ ddp = malloc(sizeof *ddp, M_PCB, M_NOWAIT | M_ZERO);
if (ddp == NULL)
return (ENOBUFS);
DDP_LOCK_INIT(ddp);
@@ -344,7 +344,7 @@ at_pcbdetach(struct socket *so, struct ddpcb *ddp)
ddp->ddp_next->ddp_prev = ddp->ddp_prev;
DDP_UNLOCK(ddp);
DDP_LOCK_DESTROY(ddp);
- FREE(ddp, M_PCB);
+ free(ddp, M_PCB);
}
/*
diff --git a/sys/netgraph/atm/sscfu/ng_sscfu_cust.h b/sys/netgraph/atm/sscfu/ng_sscfu_cust.h
index b700c1b37d5c..348575a5cfcc 100644
--- a/sys/netgraph/atm/sscfu/ng_sscfu_cust.h
+++ b/sys/netgraph/atm/sscfu/ng_sscfu_cust.h
@@ -70,13 +70,13 @@
#define MEMZALLOC(PTR, CAST, SIZE) \
((PTR) = (CAST)malloc((SIZE), M_NG_SSCFU_INS, M_NOWAIT | M_ZERO))
#define MEMFREE(PTR) \
- FREE(PTR, M_NG_SSCFU_INS)
+ free(PTR, M_NG_SSCFU_INS)
#define SIG_ALLOC(PTR) \
((PTR) = malloc(sizeof(struct sscfu_sig), \
M_NG_SSCFU_SIG, M_NOWAIT | M_ZERO))
#define SIG_FREE(PTR) \
- FREE(PTR, M_NG_SSCFU_SIG)
+ free(PTR, M_NG_SSCFU_SIG)
#endif
diff --git a/sys/netgraph/bluetooth/drivers/h4/ng_h4.c b/sys/netgraph/bluetooth/drivers/h4/ng_h4.c
index 853a31a22242..2bf1717db7f6 100644
--- a/sys/netgraph/bluetooth/drivers/h4/ng_h4.c
+++ b/sys/netgraph/bluetooth/drivers/h4/ng_h4.c
@@ -161,7 +161,7 @@ ng_h4_open(struct cdev *dev, struct tty *tp)
return (error);
/* Initialize private struct */
- MALLOC(sc, ng_h4_info_p, sizeof(*sc), M_NETGRAPH_H4, M_NOWAIT|M_ZERO);
+ sc = malloc(sizeof(*sc), M_NETGRAPH_H4, M_NOWAIT|M_ZERO);
if (sc == NULL)
return (ENOMEM);
@@ -187,7 +187,7 @@ ng_h4_open(struct cdev *dev, struct tty *tp)
mtx_destroy(&sc->outq.ifq_mtx);
bzero(sc, sizeof(*sc));
- FREE(sc, M_NETGRAPH_H4);
+ free(sc, M_NETGRAPH_H4);
return (error);
}
@@ -204,7 +204,7 @@ ng_h4_open(struct cdev *dev, struct tty *tp)
NG_NODE_UNREF(sc->node);
mtx_destroy(&sc->outq.ifq_mtx);
bzero(sc, sizeof(*sc));
- FREE(sc, M_NETGRAPH_H4);
+ free(sc, M_NETGRAPH_H4);
return (error);
}
@@ -765,7 +765,7 @@ ng_h4_shutdown(node_p node)
NG_NODE_UNREF(node);
mtx_destroy(&sc->outq.ifq_mtx);
bzero(sc, sizeof(*sc));
- FREE(sc, M_NETGRAPH_H4);
+ free(sc, M_NETGRAPH_H4);
return (0);
} /* ng_h4_shutdown */
diff --git a/sys/netgraph/bluetooth/hci/ng_hci_main.c b/sys/netgraph/bluetooth/hci/ng_hci_main.c
index 7ea23c8dfeaf..f6efbb42f674 100644
--- a/sys/netgraph/bluetooth/hci/ng_hci_main.c
+++ b/sys/netgraph/bluetooth/hci/ng_hci_main.c
@@ -109,7 +109,7 @@ ng_hci_constructor(node_p node)
{
ng_hci_unit_p unit = NULL;
- MALLOC(unit, ng_hci_unit_p, sizeof(*unit), M_NETGRAPH_HCI,
+ unit = malloc(sizeof(*unit), M_NETGRAPH_HCI,
M_NOWAIT | M_ZERO);
if (unit == NULL)
return (ENOMEM);
@@ -170,7 +170,7 @@ ng_hci_shutdown(node_p node)
NG_BT_MBUFQ_DESTROY(&unit->cmdq);
bzero(unit, sizeof(*unit));
- FREE(unit, M_NETGRAPH_HCI);
+ free(unit, M_NETGRAPH_HCI);
return (0);
} /* ng_hci_shutdown */
diff --git a/sys/netgraph/bluetooth/hci/ng_hci_misc.c b/sys/netgraph/bluetooth/hci/ng_hci_misc.c
index d7a185c71874..252a5809039e 100644
--- a/sys/netgraph/bluetooth/hci/ng_hci_misc.c
+++ b/sys/netgraph/bluetooth/hci/ng_hci_misc.c
@@ -176,7 +176,7 @@ ng_hci_new_neighbor(ng_hci_unit_p unit)
{
ng_hci_neighbor_p n = NULL;
- MALLOC(n, ng_hci_neighbor_p, sizeof(*n), M_NETGRAPH_HCI,
+ n = malloc(sizeof(*n), M_NETGRAPH_HCI,
M_NOWAIT | M_ZERO);
if (n != NULL) {
getmicrotime(&n->updated);
@@ -195,7 +195,7 @@ ng_hci_free_neighbor(ng_hci_neighbor_p n)
{
LIST_REMOVE(n, next);
bzero(n, sizeof(*n));
- FREE(n, M_NETGRAPH_HCI);
+ free(n, M_NETGRAPH_HCI);
} /* ng_hci_free_neighbor */
/*
@@ -258,7 +258,7 @@ ng_hci_new_con(ng_hci_unit_p unit, int link_type)
int num_pkts;
static int fake_con_handle = 0x0f00;
- MALLOC(con, ng_hci_unit_con_p, sizeof(*con), M_NETGRAPH_HCI,
+ con = malloc(sizeof(*con), M_NETGRAPH_HCI,
M_NOWAIT | M_ZERO);
if (con != NULL) {
con->unit = unit;
@@ -321,7 +321,7 @@ ng_hci_free_con(ng_hci_unit_con_p con)
NG_BT_ITEMQ_DESTROY(&con->conq);
bzero(con, sizeof(*con));
- FREE(con, M_NETGRAPH_HCI);
+ free(con, M_NETGRAPH_HCI);
} /* ng_hci_free_con */
/*
diff --git a/sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c b/sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c
index 7d5b300ee374..23c6b01ede35 100644
--- a/sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c
+++ b/sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c
@@ -113,7 +113,7 @@ ng_l2cap_constructor(node_p node)
ng_l2cap_p l2cap = NULL;
/* Create new L2CAP node */
- MALLOC(l2cap, ng_l2cap_p, sizeof(*l2cap),
+ l2cap = malloc(sizeof(*l2cap),
M_NETGRAPH_L2CAP, M_NOWAIT|M_ZERO);
if (l2cap == NULL)
return (ENOMEM);
@@ -148,7 +148,7 @@ ng_l2cap_shutdown(node_p node)
ng_l2cap_cleanup(l2cap);
bzero(l2cap, sizeof(*l2cap));
- FREE(l2cap, M_NETGRAPH_L2CAP);
+ free(l2cap, M_NETGRAPH_L2CAP);
return (0);
} /* ng_l2cap_shutdown */
diff --git a/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c b/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
index 635298a4e3d3..3791dcd0f0fb 100644
--- a/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
+++ b/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
@@ -104,7 +104,7 @@ ng_l2cap_new_con(ng_l2cap_p l2cap, bdaddr_p bdaddr)
ng_l2cap_con_p con = NULL;
/* Create new connection descriptor */
- MALLOC(con, ng_l2cap_con_p, sizeof(*con), M_NETGRAPH_L2CAP,
+ con = malloc(sizeof(*con), M_NETGRAPH_L2CAP,
M_NOWAIT|M_ZERO);
if (con == NULL)
return (NULL);
@@ -284,7 +284,7 @@ ng_l2cap_free_con(ng_l2cap_con_p con)
LIST_REMOVE(con, next);
bzero(con, sizeof(*con));
- FREE(con, M_NETGRAPH_L2CAP);
+ free(con, M_NETGRAPH_L2CAP);
} /* ng_l2cap_free_con */
/*
@@ -329,7 +329,7 @@ ng_l2cap_new_chan(ng_l2cap_p l2cap, ng_l2cap_con_p con, u_int16_t psm)
{
ng_l2cap_chan_p ch = NULL;
- MALLOC(ch, ng_l2cap_chan_p, sizeof(*ch), M_NETGRAPH_L2CAP,
+ ch = malloc(sizeof(*ch), M_NETGRAPH_L2CAP,
M_NOWAIT|M_ZERO);
if (ch == NULL)
return (NULL);
@@ -357,7 +357,7 @@ ng_l2cap_new_chan(ng_l2cap_p l2cap, ng_l2cap_con_p con, u_int16_t psm)
ng_l2cap_con_ref(con);
} else {
bzero(ch, sizeof(*ch));
- FREE(ch, M_NETGRAPH_L2CAP);
+ free(ch, M_NETGRAPH_L2CAP);
ch = NULL;
}
@@ -408,7 +408,7 @@ ng_l2cap_free_chan(ng_l2cap_chan_p ch)
ng_l2cap_con_unref(ch->con);
bzero(ch, sizeof(*ch));
- FREE(ch, M_NETGRAPH_L2CAP);
+ free(ch, M_NETGRAPH_L2CAP);
} /* ng_l2cap_free_chan */
/*
@@ -425,7 +425,7 @@ ng_l2cap_new_cmd(ng_l2cap_con_p con, ng_l2cap_chan_p ch, u_int8_t ident,
("%s: %s - invalid channel pointer!\n",
__func__, NG_NODE_NAME(con->l2cap->node)));
- MALLOC(cmd, ng_l2cap_cmd_p, sizeof(*cmd), M_NETGRAPH_L2CAP,
+ cmd = malloc(sizeof(*cmd), M_NETGRAPH_L2CAP,
M_NOWAIT|M_ZERO);
if (cmd == NULL)
return (NULL);
diff --git a/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.h b/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.h
index ad97107e04c2..22cff48eed7c 100644
--- a/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.h
+++ b/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.h
@@ -76,7 +76,7 @@ do { \
KASSERT(!callout_pending(&(cmd)->timo), ("Pending callout!")); \
NG_FREE_M((cmd)->aux); \
bzero((cmd), sizeof(*(cmd))); \
- FREE((cmd), M_NETGRAPH_L2CAP); \
+ free((cmd), M_NETGRAPH_L2CAP); \
} while (0)
ng_l2cap_cmd_p ng_l2cap_new_cmd (ng_l2cap_con_p, ng_l2cap_chan_p,
diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c
index 6b3002240387..8bde5362ff84 100644
--- a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c
+++ b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c
@@ -783,14 +783,10 @@ ng_btsocket_hci_raw_init(void)
/*
* Security filter
- * XXX never FREE()ed
+ * XXX never free()ed
*/
-
- ng_btsocket_hci_raw_sec_filter = NULL;
-
- MALLOC(ng_btsocket_hci_raw_sec_filter,
- struct ng_btsocket_hci_raw_sec_filter *,
- sizeof(struct ng_btsocket_hci_raw_sec_filter),
+ ng_btsocket_hci_raw_sec_filter =
+ malloc(sizeof(struct ng_btsocket_hci_raw_sec_filter),
M_NETGRAPH_BTSOCKET_HCI_RAW, M_NOWAIT|M_ZERO);
if (ng_btsocket_hci_raw_sec_filter == NULL) {
printf("%s: Could not allocate security filter!\n", __func__);
@@ -914,7 +910,7 @@ ng_btsocket_hci_raw_attach(struct socket *so, int proto, struct thread *td)
if (error != 0)
return (error);
- MALLOC(pcb, ng_btsocket_hci_raw_pcb_p, sizeof(*pcb),
+ pcb = malloc(sizeof(*pcb),
M_NETGRAPH_BTSOCKET_HCI_RAW, M_NOWAIT|M_ZERO);
if (pcb == NULL)
return (ENOMEM);
@@ -1493,7 +1489,7 @@ ng_btsocket_hci_raw_detach(struct socket *so)
mtx_destroy(&pcb->pcb_mtx);
bzero(pcb, sizeof(*pcb));
- FREE(pcb, M_NETGRAPH_BTSOCKET_HCI_RAW);
+ free(pcb, M_NETGRAPH_BTSOCKET_HCI_RAW);
so->so_pcb = NULL;
} /* ng_btsocket_hci_raw_detach */
diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c
index 11ef1dff8526..b7b42fc49845 100644
--- a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c
+++ b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c
@@ -1563,7 +1563,7 @@ ng_btsocket_l2cap_default_msg_input(struct ng_mesg *msg, hook_p hook)
rt = (ng_btsocket_l2cap_rtentry_t *) NG_HOOK_PRIVATE(hook);
if (rt == NULL) {
- MALLOC(rt, ng_btsocket_l2cap_rtentry_p, sizeof(*rt),
+ rt = malloc(sizeof(*rt),
M_NETGRAPH_BTSOCKET_L2CAP, M_NOWAIT|M_ZERO);
if (rt == NULL) {
mtx_unlock(&ng_btsocket_l2cap_rt_mtx);
@@ -1788,7 +1788,7 @@ ng_btsocket_l2cap_rtclean(void *context, int pending)
NG_HOOK_UNREF(rt->hook); /* Remove extra reference */
bzero(rt, sizeof(*rt));
- FREE(rt, M_NETGRAPH_BTSOCKET_L2CAP);
+ free(rt, M_NETGRAPH_BTSOCKET_L2CAP);
}
rt = rt_next;
@@ -1930,7 +1930,7 @@ ng_btsocket_l2cap_attach(struct socket *so, int proto, struct thread *td)
}
/* Allocate the PCB */
- MALLOC(pcb, ng_btsocket_l2cap_pcb_p, sizeof(*pcb),
+ pcb = malloc(sizeof(*pcb),
M_NETGRAPH_BTSOCKET_L2CAP, M_NOWAIT | M_ZERO);
if (pcb == NULL)
return (ENOMEM);
@@ -2310,7 +2310,7 @@ ng_btsocket_l2cap_detach(struct socket *so)
mtx_destroy(&pcb->pcb_mtx);
bzero(pcb, sizeof(*pcb));
- FREE(pcb, M_NETGRAPH_BTSOCKET_L2CAP);
+ free(pcb, M_NETGRAPH_BTSOCKET_L2CAP);
soisdisconnected(so);
so->so_pcb = NULL;
diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c
index f7190f7f5bc9..2d2e00665180 100644
--- a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c
+++ b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c
@@ -377,8 +377,7 @@ ng_btsocket_l2cap_raw_input(void *context, int pending)
rt = (ng_btsocket_l2cap_rtentry_t *)
NG_HOOK_PRIVATE(hook);
if (rt == NULL) {
- MALLOC(rt, ng_btsocket_l2cap_rtentry_p,
- sizeof(*rt),
+ rt = malloc( sizeof(*rt),
M_NETGRAPH_BTSOCKET_L2CAP_RAW,
M_NOWAIT|M_ZERO);
if (rt == NULL)
@@ -496,7 +495,7 @@ ng_btsocket_l2cap_raw_rtclean(void *context, int pending)
NG_HOOK_UNREF(rt->hook); /* Remove extra reference */
bzero(rt, sizeof(*rt));
- FREE(rt, M_NETGRAPH_BTSOCKET_L2CAP_RAW);
+ free(rt, M_NETGRAPH_BTSOCKET_L2CAP_RAW);
}
rt = rt_next;
@@ -618,7 +617,7 @@ ng_btsocket_l2cap_raw_attach(struct socket *so, int proto, struct thread *td)
return (error);
/* Allocate the PCB */
- MALLOC(pcb, ng_btsocket_l2cap_raw_pcb_p, sizeof(*pcb),
+ pcb = malloc(sizeof(*pcb),
M_NETGRAPH_BTSOCKET_L2CAP_RAW, M_NOWAIT|M_ZERO);
if (pcb == NULL)
return (ENOMEM);
@@ -1129,7 +1128,7 @@ ng_btsocket_l2cap_raw_detach(struct socket *so)
mtx_destroy(&pcb->pcb_mtx);
bzero(pcb, sizeof(*pcb));
- FREE(pcb, M_NETGRAPH_BTSOCKET_L2CAP_RAW);
+ free(pcb, M_NETGRAPH_BTSOCKET_L2CAP_RAW);
so->so_pcb = NULL;
} /* ng_btsocket_l2cap_raw_detach */
diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c b/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c
index a3f344d61f67..0fc193890168 100644
--- a/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c
+++ b/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c
@@ -405,7 +405,7 @@ ng_btsocket_rfcomm_attach(struct socket *so, int proto, struct thread *td)
}
/* Allocate the PCB */
- MALLOC(pcb, ng_btsocket_rfcomm_pcb_p, sizeof(*pcb),
+ pcb = malloc(sizeof(*pcb),
M_NETGRAPH_BTSOCKET_RFCOMM, M_NOWAIT | M_ZERO);
if (pcb == NULL)
return (ENOMEM);
@@ -751,7 +751,7 @@ ng_btsocket_rfcomm_detach(struct socket *so)
mtx_destroy(&pcb->pcb_mtx);
bzero(pcb, sizeof(*pcb));
- FREE(pcb, M_NETGRAPH_BTSOCKET_RFCOMM);
+ free(pcb, M_NETGRAPH_BTSOCKET_RFCOMM);
soisdisconnected(so);
so->so_pcb = NULL;
@@ -1069,7 +1069,7 @@ ng_btsocket_rfcomm_sessions_task(void *ctx, int pending)
mtx_destroy(&s->session_mtx);
bzero(s, sizeof(*s));
- FREE(s, M_NETGRAPH_BTSOCKET_RFCOMM);
+ free(s, M_NETGRAPH_BTSOCKET_RFCOMM);
} else
mtx_unlock(&s->session_mtx);
@@ -1270,7 +1270,7 @@ ng_btsocket_rfcomm_session_create(ng_btsocket_rfcomm_session_p *sp,
mtx_assert(&ng_btsocket_rfcomm_sessions_mtx, MA_OWNED);
/* Allocate the RFCOMM session */
- MALLOC(s, ng_btsocket_rfcomm_session_p, sizeof(*s),
+ s = malloc(sizeof(*s),
M_NETGRAPH_BTSOCKET_RFCOMM, M_NOWAIT | M_ZERO);
if (s == NULL)
return (ENOMEM);
@@ -1390,7 +1390,7 @@ bad:
mtx_destroy(&s->session_mtx);
bzero(s, sizeof(*s));
- FREE(s, M_NETGRAPH_BTSOCKET_RFCOMM);
+ free(s, M_NETGRAPH_BTSOCKET_RFCOMM);
return (error);
} /* ng_btsocket_rfcomm_session_create */
diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c b/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c
index ea20759ab865..9dae14a1294f 100644
--- a/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c
+++ b/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c
@@ -828,7 +828,7 @@ ng_btsocket_sco_default_msg_input(struct ng_mesg *msg, hook_p hook)
break;
if (rt == NULL) {
- MALLOC(rt, ng_btsocket_sco_rtentry_p, sizeof(*rt),
+ rt = malloc(sizeof(*rt),
M_NETGRAPH_BTSOCKET_SCO, M_NOWAIT|M_ZERO);
if (rt == NULL)
break;
@@ -1083,7 +1083,7 @@ ng_btsocket_sco_rtclean(void *context, int pending)
NG_HOOK_UNREF(rt->hook); /* Remove extra reference */
bzero(rt, sizeof(*rt));
- FREE(rt, M_NETGRAPH_BTSOCKET_SCO);
+ free(rt, M_NETGRAPH_BTSOCKET_SCO);
}
rt = rt_next;
@@ -1221,7 +1221,7 @@ ng_btsocket_sco_attach(struct socket *so, int proto, struct thread *td)
}
/* Allocate the PCB */
- MALLOC(pcb, ng_btsocket_sco_pcb_p, sizeof(*pcb),
+ pcb = malloc(sizeof(*pcb),
M_NETGRAPH_BTSOCKET_SCO, M_NOWAIT | M_ZERO);
if (pcb == NULL)
return (ENOMEM);
@@ -1538,7 +1538,7 @@ ng_btsocket_sco_detach(struct socket *so)
mtx_destroy(&pcb->pcb_mtx);
bzero(pcb, sizeof(*pcb));
- FREE(pcb, M_NETGRAPH_BTSOCKET_SCO);
+ free(pcb, M_NETGRAPH_BTSOCKET_SCO);
soisdisconnected(so);
so->so_pcb = NULL;
diff --git a/sys/netgraph/netflow/netflow.c b/sys/netgraph/netflow/netflow.c
index 29193abaab5f..bf261a90fede 100644
--- a/sys/netgraph/netflow/netflow.c
+++ b/sys/netgraph/netflow/netflow.c
@@ -331,8 +331,7 @@ ng_netflow_cache_init(priv_p priv)
uma_zone_set_max(priv->zone, CACHESIZE);
/* Allocate hash. */
- MALLOC(priv->hash, struct flow_hash_entry *,
- NBUCKETS * sizeof(struct flow_hash_entry),
+ priv->hash = malloc( NBUCKETS * sizeof(struct flow_hash_entry),
M_NETFLOW_HASH, M_WAITOK | M_ZERO);
if (priv->hash == NULL) {
@@ -382,7 +381,7 @@ ng_netflow_cache_flush(priv_p priv)
/* Free hash memory. */
if (priv->hash)
- FREE(priv->hash, M_NETFLOW_HASH);
+ free(priv->hash, M_NETFLOW_HASH);
mtx_destroy(&priv->export_mtx);
}
diff --git a/sys/netgraph/netflow/ng_netflow.c b/sys/netgraph/netflow/ng_netflow.c
index 76fece8d96d0..d43c976ba4f9 100644
--- a/sys/netgraph/netflow/ng_netflow.c
+++ b/sys/netgraph/netflow/ng_netflow.c
@@ -185,7 +185,7 @@ ng_netflow_constructor(node_p node)
int error = 0, i;
/* Initialize private data */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT);
+ priv = malloc(sizeof(*priv), M_NETGRAPH, M_NOWAIT);
if (priv == NULL)
return (ENOMEM);
bzero(priv, sizeof(*priv));
@@ -708,7 +708,7 @@ ng_netflow_rmnode(node_p node)
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(priv->node);
- FREE(priv, M_NETGRAPH);
+ free(priv, M_NETGRAPH);
return (0);
}
diff --git a/sys/netgraph/netgraph.h b/sys/netgraph/netgraph.h
index 1fc0b19fdf4c..78af963eaaf5 100644
--- a/sys/netgraph/netgraph.h
+++ b/sys/netgraph/netgraph.h
@@ -915,7 +915,7 @@ _ngi_hook(item_p item, char *file, int line)
#define NG_FREE_MSG(msg) \
do { \
if ((msg)) { \
- FREE((msg), M_NETGRAPH_MSG); \
+ free((msg), M_NETGRAPH_MSG); \
(msg) = NULL; \
} \
} while (0)
diff --git a/sys/netgraph/ng_UI.c b/sys/netgraph/ng_UI.c
index 4755eb34292d..a8968776f847 100644
--- a/sys/netgraph/ng_UI.c
+++ b/sys/netgraph/ng_UI.c
@@ -103,7 +103,7 @@ ng_UI_constructor(node_p node)
priv_p priv;
/* Allocate private structure */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
+ priv = malloc(sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
if (priv == NULL) {
return (ENOMEM);
}
@@ -215,7 +215,7 @@ ng_UI_shutdown(node_p node)
const priv_p priv = NG_NODE_PRIVATE(node);
/* Take down netgraph node */
- FREE(priv, M_NETGRAPH);
+ free(priv, M_NETGRAPH);
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(node);
return (0);
diff --git a/sys/netgraph/ng_async.c b/sys/netgraph/ng_async.c
index 6cb534508f9f..68416178ca67 100644
--- a/sys/netgraph/ng_async.c
+++ b/sys/netgraph/ng_async.c
@@ -183,23 +183,21 @@ nga_constructor(node_p node)
{
sc_p sc;
- MALLOC(sc, sc_p, sizeof(*sc), M_NETGRAPH_ASYNC, M_NOWAIT | M_ZERO);
+ sc = malloc(sizeof(*sc), M_NETGRAPH_ASYNC, M_NOWAIT | M_ZERO);
if (sc == NULL)
return (ENOMEM);
sc->amode = MODE_HUNT;
sc->cfg.accm = ~0;
sc->cfg.amru = NG_ASYNC_DEFAULT_MRU;
sc->cfg.smru = NG_ASYNC_DEFAULT_MRU;
- MALLOC(sc->abuf, u_char *,
- ASYNC_BUF_SIZE(sc->cfg.smru), M_NETGRAPH_ASYNC, M_NOWAIT);
+ sc->abuf = malloc( ASYNC_BUF_SIZE(sc->cfg.smru), M_NETGRAPH_ASYNC, M_NOWAIT);
if (sc->abuf == NULL)
goto fail;
- MALLOC(sc->sbuf, u_char *,
- SYNC_BUF_SIZE(sc->cfg.amru), M_NETGRAPH_ASYNC, M_NOWAIT);
+ sc->sbuf = malloc( SYNC_BUF_SIZE(sc->cfg.amru), M_NETGRAPH_ASYNC, M_NOWAIT);
if (sc->sbuf == NULL) {
- FREE(sc->abuf, M_NETGRAPH_ASYNC);
+ free(sc->abuf, M_NETGRAPH_ASYNC);
fail:
- FREE(sc, M_NETGRAPH_ASYNC);
+ free(sc, M_NETGRAPH_ASYNC);
return (ENOMEM);
}
NG_NODE_SET_PRIVATE(node, sc);
@@ -298,19 +296,19 @@ nga_rcvmsg(node_p node, item_p item, hook_p lasthook)
ERROUT(EINVAL);
cfg->enabled = !!cfg->enabled; /* normalize */
if (cfg->smru > sc->cfg.smru) { /* reallocate buffer */
- MALLOC(buf, u_char *, ASYNC_BUF_SIZE(cfg->smru),
+ buf = malloc(ASYNC_BUF_SIZE(cfg->smru),
M_NETGRAPH_ASYNC, M_NOWAIT);
if (!buf)
ERROUT(ENOMEM);
- FREE(sc->abuf, M_NETGRAPH_ASYNC);
+ free(sc->abuf, M_NETGRAPH_ASYNC);
sc->abuf = buf;
}
if (cfg->amru > sc->cfg.amru) { /* reallocate buffer */
- MALLOC(buf, u_char *, SYNC_BUF_SIZE(cfg->amru),
+ buf = malloc(SYNC_BUF_SIZE(cfg->amru),
M_NETGRAPH_ASYNC, M_NOWAIT);
if (!buf)
ERROUT(ENOMEM);
- FREE(sc->sbuf, M_NETGRAPH_ASYNC);
+ free(sc->sbuf, M_NETGRAPH_ASYNC);
sc->sbuf = buf;
sc->amode = MODE_HUNT;
sc->slen = 0;
@@ -349,10 +347,10 @@ nga_shutdown(node_p node)
{
const sc_p sc = NG_NODE_PRIVATE(node);
- FREE(sc->abuf, M_NETGRAPH_ASYNC);
- FREE(sc->sbuf, M_NETGRAPH_ASYNC);
+ free(sc->abuf, M_NETGRAPH_ASYNC);
+ free(sc->sbuf, M_NETGRAPH_ASYNC);
bzero(sc, sizeof(*sc));
- FREE(sc, M_NETGRAPH_ASYNC);
+ free(sc, M_NETGRAPH_ASYNC);
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(node);
return (0);
diff --git a/sys/netgraph/ng_atmllc.c b/sys/netgraph/ng_atmllc.c
index 64bf8c3f5c25..64980561ce64 100644
--- a/sys/netgraph/ng_atmllc.c
+++ b/sys/netgraph/ng_atmllc.c
@@ -80,7 +80,7 @@ ng_atmllc_constructor(node_p node)
{
struct ng_atmllc_priv *priv;
- MALLOC(priv, struct ng_atmllc_priv *, sizeof(*priv), M_NETGRAPH,
+ priv = malloc(sizeof(*priv), M_NETGRAPH,
M_NOWAIT | M_ZERO);
if (priv == NULL) {
return (ENOMEM);
@@ -111,7 +111,7 @@ ng_atmllc_shutdown(node_p node)
priv = NG_NODE_PRIVATE(node);
- FREE(priv, M_NETGRAPH);
+ free(priv, M_NETGRAPH);
NG_NODE_UNREF(node);
diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c
index 2a84d429f29e..6a0ce8853786 100644
--- a/sys/netgraph/ng_base.c
+++ b/sys/netgraph/ng_base.c
@@ -234,9 +234,9 @@ MALLOC_DEFINE(M_NETGRAPH_MSG, "netgraph_msg", "netgraph name storage");
/* Should not be visible outside this file */
#define _NG_ALLOC_HOOK(hook) \
- MALLOC(hook, hook_p, sizeof(*hook), M_NETGRAPH_HOOK, M_NOWAIT | M_ZERO)
+ hook = malloc(sizeof(*hook), M_NETGRAPH_HOOK, M_NOWAIT | M_ZERO)
#define _NG_ALLOC_NODE(node) \
- MALLOC(node, node_p, sizeof(*node), M_NETGRAPH_NODE, M_NOWAIT | M_ZERO)
+ node = malloc(sizeof(*node), M_NETGRAPH_NODE, M_NOWAIT | M_ZERO)
#define NG_QUEUE_LOCK_INIT(n) \
mtx_init(&(n)->q_mtx, "ng_node", NULL, MTX_DEF)
@@ -339,8 +339,8 @@ ng_alloc_node(void)
#define NG_ALLOC_HOOK(hook) _NG_ALLOC_HOOK(hook)
#define NG_ALLOC_NODE(node) _NG_ALLOC_NODE(node)
-#define NG_FREE_HOOK(hook) do { FREE((hook), M_NETGRAPH_HOOK); } while (0)
-#define NG_FREE_NODE(node) do { FREE((node), M_NETGRAPH_NODE); } while (0)
+#define NG_FREE_HOOK(hook) do { free((hook), M_NETGRAPH_HOOK); } while (0)
+#define NG_FREE_NODE(node) do { free((node), M_NETGRAPH_NODE); } while (0)
#endif /* NETGRAPH_DEBUG */ /*----------------------------------------------*/
diff --git a/sys/netgraph/ng_bpf.c b/sys/netgraph/ng_bpf.c
index 7d7aa26a2585..50a6bf7b539d 100644
--- a/sys/netgraph/ng_bpf.c
+++ b/sys/netgraph/ng_bpf.c
@@ -277,7 +277,7 @@ ng_bpf_newhook(node_p node, hook_p hook, const char *name)
int error;
/* Create hook private structure */
- MALLOC(hip, hinfo_p, sizeof(*hip), M_NETGRAPH_BPF, M_NOWAIT | M_ZERO);
+ hip = malloc(sizeof(*hip), M_NETGRAPH_BPF, M_NOWAIT | M_ZERO);
if (hip == NULL)
return (ENOMEM);
hip->hook = hook;
@@ -288,7 +288,7 @@ ng_bpf_newhook(node_p node, hook_p hook, const char *name)
/* Attach the default BPF program */
if ((error = ng_bpf_setprog(hook, &ng_bpf_default_prog)) != 0) {
- FREE(hip, M_NETGRAPH_BPF);
+ free(hip, M_NETGRAPH_BPF);
NG_HOOK_SET_PRIVATE(hook, NULL);
return (error);
}
@@ -445,7 +445,7 @@ ng_bpf_rcvdata(hook_p hook, item_p item)
/* Need to put packet in contiguous memory for bpf */
if (m->m_next != NULL && totlen > MHLEN) {
if (usejit) {
- MALLOC(data, u_char *, totlen, M_NETGRAPH_BPF, M_NOWAIT);
+ data = malloc(totlen, M_NETGRAPH_BPF, M_NOWAIT);
if (data == NULL) {
NG_FREE_ITEM(item);
return (ENOMEM);
@@ -475,7 +475,7 @@ ng_bpf_rcvdata(hook_p hook, item_p item)
else
len = bpf_filter(hip->prog->bpf_prog, (u_char *)m, totlen, 0);
if (needfree)
- FREE(data, M_NETGRAPH_BPF);
+ free(data, M_NETGRAPH_BPF);
ready:
/* See if we got a match and find destination hook */
if (len > 0) {
@@ -532,12 +532,12 @@ ng_bpf_disconnect(hook_p hook)
/* Remove our reference from other hooks data. */
NG_NODE_FOREACH_HOOK(node, ng_bpf_remrefs, hook, tmp);
- FREE(hip->prog, M_NETGRAPH_BPF);
+ free(hip->prog, M_NETGRAPH_BPF);
#ifdef BPF_JITTER
if (hip->jit_prog != NULL)
bpf_destroy_jit_filter(hip->jit_prog);
#endif
- FREE(hip, M_NETGRAPH_BPF);
+ free(hip, M_NETGRAPH_BPF);
if ((NG_NODE_NUMHOOKS(node) == 0) &&
(NG_NODE_IS_VALID(node))) {
ng_rmnode_self(node);
@@ -569,7 +569,7 @@ ng_bpf_setprog(hook_p hook, const struct ng_bpf_hookprog *hp0)
/* Make a copy of the program */
size = NG_BPF_HOOKPROG_SIZE(hp0->bpf_prog_len);
- MALLOC(hp, struct ng_bpf_hookprog *, size, M_NETGRAPH_BPF, M_NOWAIT);
+ hp = malloc(size, M_NETGRAPH_BPF, M_NOWAIT);
if (hp == NULL)
return (ENOMEM);
bcopy(hp0, hp, size);
@@ -579,7 +579,7 @@ ng_bpf_setprog(hook_p hook, const struct ng_bpf_hookprog *hp0)
/* Free previous program, if any, and assign new one */
if (hip->prog != NULL)
- FREE(hip->prog, M_NETGRAPH_BPF);
+ free(hip->prog, M_NETGRAPH_BPF);
hip->prog = hp;
#ifdef BPF_JITTER
if (hip->jit_prog != NULL)
diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c
index 5f9c835c1e8e..da48f234d958 100644
--- a/sys/netgraph/ng_bridge.c
+++ b/sys/netgraph/ng_bridge.c
@@ -298,16 +298,15 @@ ng_bridge_constructor(node_p node)
priv_p priv;
/* Allocate and initialize private info */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH_BRIDGE, M_NOWAIT | M_ZERO);
+ priv = malloc(sizeof(*priv), M_NETGRAPH_BRIDGE, M_NOWAIT | M_ZERO);
if (priv == NULL)
return (ENOMEM);
ng_callout_init(&priv->timer);
/* Allocate and initialize hash table, etc. */
- MALLOC(priv->tab, struct ng_bridge_bucket *,
- MIN_BUCKETS * sizeof(*priv->tab), M_NETGRAPH_BRIDGE, M_NOWAIT | M_ZERO);
+ priv->tab = malloc( MIN_BUCKETS * sizeof(*priv->tab), M_NETGRAPH_BRIDGE, M_NOWAIT | M_ZERO);
if (priv->tab == NULL) {
- FREE(priv, M_NETGRAPH_BRIDGE);
+ free(priv, M_NETGRAPH_BRIDGE);
return (ENOMEM);
}
priv->numBuckets = MIN_BUCKETS;
@@ -359,8 +358,7 @@ ng_bridge_newhook(node_p node, hook_p hook, const char *name)
return (EINVAL);
if (priv->links[linkNum] != NULL)
return (EISCONN);
- MALLOC(priv->links[linkNum], struct ng_bridge_link *,
- sizeof(*priv->links[linkNum]), M_NETGRAPH_BRIDGE, M_NOWAIT|M_ZERO);
+ priv->links[linkNum] = malloc( sizeof(*priv->links[linkNum]), M_NETGRAPH_BRIDGE, M_NOWAIT|M_ZERO);
if (priv->links[linkNum] == NULL)
return (ENOMEM);
priv->links[linkNum]->hook = hook;
@@ -767,8 +765,8 @@ ng_bridge_shutdown(node_p node)
ng_uncallout(&priv->timer, node);
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(node);
- FREE(priv->tab, M_NETGRAPH_BRIDGE);
- FREE(priv, M_NETGRAPH_BRIDGE);
+ free(priv->tab, M_NETGRAPH_BRIDGE);
+ free(priv, M_NETGRAPH_BRIDGE);
return (0);
}
@@ -791,7 +789,7 @@ ng_bridge_disconnect(hook_p hook)
/* Free associated link information */
KASSERT(priv->links[linkNum] != NULL, ("%s: no link", __func__));
- FREE(priv->links[linkNum], M_NETGRAPH_BRIDGE);
+ free(priv->links[linkNum], M_NETGRAPH_BRIDGE);
priv->links[linkNum] = NULL;
priv->numLinks--;
@@ -850,8 +848,7 @@ ng_bridge_put(priv_p priv, const u_char *addr, int linkNum)
#endif
/* Allocate and initialize new hashtable entry */
- MALLOC(hent, struct ng_bridge_hent *,
- sizeof(*hent), M_NETGRAPH_BRIDGE, M_NOWAIT);
+ hent = malloc( sizeof(*hent), M_NETGRAPH_BRIDGE, M_NOWAIT);
if (hent == NULL)
return (0);
bcopy(addr, hent->host.addr, ETHER_ADDR_LEN);
@@ -895,8 +892,7 @@ ng_bridge_rehash(priv_p priv)
newMask = newNumBuckets - 1;
/* Allocate and initialize new table */
- MALLOC(newTab, struct ng_bridge_bucket *,
- newNumBuckets * sizeof(*newTab), M_NETGRAPH_BRIDGE, M_NOWAIT | M_ZERO);
+ newTab = malloc( newNumBuckets * sizeof(*newTab), M_NETGRAPH_BRIDGE, M_NOWAIT | M_ZERO);
if (newTab == NULL)
return;
@@ -920,7 +916,7 @@ ng_bridge_rehash(priv_p priv)
ng_bridge_nodename(priv->node),
priv->numBuckets, newNumBuckets);
}
- FREE(priv->tab, M_NETGRAPH_BRIDGE);
+ free(priv->tab, M_NETGRAPH_BRIDGE);
priv->numBuckets = newNumBuckets;
priv->hashMask = newMask;
priv->tab = newTab;
@@ -948,7 +944,7 @@ ng_bridge_remove_hosts(priv_p priv, int linkNum)
if (linkNum == -1 || hent->host.linkNum == linkNum) {
*hptr = SLIST_NEXT(hent, next);
- FREE(hent, M_NETGRAPH_BRIDGE);
+ free(hent, M_NETGRAPH_BRIDGE);
priv->numHosts--;
} else
hptr = &SLIST_NEXT(hent, next);
@@ -986,7 +982,7 @@ ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2)
/* Remove hosts we haven't heard from in a while */
if (++hent->host.staleness >= priv->conf.maxStaleness) {
*hptr = SLIST_NEXT(hent, next);
- FREE(hent, M_NETGRAPH_BRIDGE);
+ free(hent, M_NETGRAPH_BRIDGE);
priv->numHosts--;
} else {
if (hent->host.age < 0xffff)
diff --git a/sys/netgraph/ng_cisco.c b/sys/netgraph/ng_cisco.c
index 187523a52cec..785b0558f00f 100644
--- a/sys/netgraph/ng_cisco.c
+++ b/sys/netgraph/ng_cisco.c
@@ -193,7 +193,7 @@ cisco_constructor(node_p node)
{
sc_p sc;
- MALLOC(sc, sc_p, sizeof(*sc), M_NETGRAPH, M_NOWAIT | M_ZERO);
+ sc = malloc(sizeof(*sc), M_NETGRAPH, M_NOWAIT | M_ZERO);
if (sc == NULL)
return (ENOMEM);
@@ -408,7 +408,7 @@ cisco_shutdown(node_p node)
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(sc->node);
- FREE(sc, M_NETGRAPH);
+ free(sc, M_NETGRAPH);
return (0);
}
diff --git a/sys/netgraph/ng_device.c b/sys/netgraph/ng_device.c
index 5db921881af3..eb094bef2ace 100644
--- a/sys/netgraph/ng_device.c
+++ b/sys/netgraph/ng_device.c
@@ -163,7 +163,7 @@ ng_device_constructor(node_p node)
DBG;
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
+ priv = malloc(sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
if (priv == NULL)
return (ENOMEM);
@@ -186,7 +186,7 @@ ng_device_constructor(node_p node)
mtx_destroy(&priv->ngd_mtx);
mtx_destroy(&priv->readq.ifq_mtx);
free_unr(ngd_unit, priv->unit);
- FREE(priv, M_NETGRAPH);
+ free(priv, M_NETGRAPH);
return(EINVAL);
}
/* XXX: race here? */
@@ -307,7 +307,7 @@ ng_device_disconnect(hook_p hook)
free_unr(ngd_unit, priv->unit);
- FREE(priv, M_NETGRAPH);
+ free(priv, M_NETGRAPH);
ng_rmnode_self(NG_HOOK_NODE(hook));
diff --git a/sys/netgraph/ng_eiface.c b/sys/netgraph/ng_eiface.c
index dc52f957294f..09011d2d6d55 100644
--- a/sys/netgraph/ng_eiface.c
+++ b/sys/netgraph/ng_eiface.c
@@ -339,7 +339,7 @@ ng_eiface_constructor(node_p node)
u_char eaddr[6] = {0,0,0,0,0,0};
/* Allocate node and interface private structures */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
+ priv = malloc(sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
if (priv == NULL)
return (ENOMEM);
@@ -559,7 +559,7 @@ ng_eiface_rmnode(node_p node)
if_free(ifp);
CURVNET_RESTORE();
free_unr(V_ng_eiface_unit, priv->unit);
- FREE(priv, M_NETGRAPH);
+ free(priv, M_NETGRAPH);
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(node);
return (0);
diff --git a/sys/netgraph/ng_etf.c b/sys/netgraph/ng_etf.c
index 11a0d96611b6..7e607f79948b 100644
--- a/sys/netgraph/ng_etf.c
+++ b/sys/netgraph/ng_etf.c
@@ -180,7 +180,7 @@ ng_etf_constructor(node_p node)
int i;
/* Initialize private descriptor */
- MALLOC(privdata, etf_p, sizeof(*privdata), M_NETGRAPH_ETF,
+ privdata = malloc(sizeof(*privdata), M_NETGRAPH_ETF,
M_NOWAIT | M_ZERO);
if (privdata == NULL)
return (ENOMEM);
@@ -217,7 +217,7 @@ ng_etf_newhook(node_p node, hook_p hook, const char *name)
* Any other hook name is valid and can
* later be associated with a filter rule.
*/
- MALLOC(hpriv, struct ETF_hookinfo *, sizeof(*hpriv),
+ hpriv = malloc(sizeof(*hpriv),
M_NETGRAPH_ETF, M_NOWAIT | M_ZERO);
if (hpriv == NULL) {
return (ENOMEM);
@@ -317,7 +317,7 @@ ng_etf_rcvmsg(node_p node, item_p item, hook_p lasthook)
* Ok, make the filter and put it in the
* hashtable ready for matching.
*/
- MALLOC(fil, struct filter *, sizeof(*fil),
+ fil = malloc(sizeof(*fil),
M_NETGRAPH_ETF, M_NOWAIT | M_ZERO);
if (fil == NULL) {
error = ENOMEM;
@@ -440,7 +440,7 @@ ng_etf_shutdown(node_p node)
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(privdata->node);
- FREE(privdata, M_NETGRAPH_ETF);
+ free(privdata, M_NETGRAPH_ETF);
return (0);
}
@@ -463,7 +463,7 @@ ng_etf_disconnect(hook_p hook)
fil2 = LIST_NEXT(fil1, next);
if (fil1->match_hook == hook) {
LIST_REMOVE(fil1, next);
- FREE(fil1, M_NETGRAPH_ETF);
+ free(fil1, M_NETGRAPH_ETF);
}
fil1 = fil2;
}
@@ -476,7 +476,7 @@ ng_etf_disconnect(hook_p hook)
etfp->nomatch_hook.hook = NULL;
} else {
if (NG_HOOK_PRIVATE(hook)) /* Paranoia */
- FREE(NG_HOOK_PRIVATE(hook), M_NETGRAPH_ETF);
+ free(NG_HOOK_PRIVATE(hook), M_NETGRAPH_ETF);
}
NG_HOOK_SET_PRIVATE(hook, NULL);
diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c
index 115f3cfee09a..9bcd374a21f8 100644
--- a/sys/netgraph/ng_ether.c
+++ b/sys/netgraph/ng_ether.c
@@ -292,7 +292,7 @@ ng_ether_attach(struct ifnet *ifp)
}
/* Allocate private data */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
+ priv = malloc(sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
if (priv == NULL) {
log(LOG_ERR, "%s: can't %s for %s\n",
__func__, "allocate memory", ifp->if_xname);
@@ -683,7 +683,7 @@ ng_ether_shutdown(node_p node)
* Assume the ifp has already been freed.
*/
NG_NODE_SET_PRIVATE(node, NULL);
- FREE(priv, M_NETGRAPH);
+ free(priv, M_NETGRAPH);
NG_NODE_UNREF(node); /* free node itself */
return (0);
}
diff --git a/sys/netgraph/ng_fec.c b/sys/netgraph/ng_fec.c
index 58f16a942d7f..83a34625e707 100644
--- a/sys/netgraph/ng_fec.c
+++ b/sys/netgraph/ng_fec.c
@@ -284,7 +284,7 @@ ng_fec_get_unit(int *unit)
int i, *newarray, newlen;
newlen = (2 * ng_fec_units_len) + 4;
- MALLOC(newarray, int *, newlen * sizeof(*ng_fec_units),
+ newarray = malloc(newlen * sizeof(*ng_fec_units),
M_NETGRAPH, M_NOWAIT);
if (newarray == NULL) {
mtx_unlock(&ng_fec_mtx);
@@ -295,7 +295,7 @@ ng_fec_get_unit(int *unit)
for (i = ng_fec_units_len; i < newlen; i++)
newarray[i] = ~0;
if (ng_fec_units != NULL)
- FREE(ng_fec_units, M_NETGRAPH);
+ free(ng_fec_units, M_NETGRAPH);
ng_fec_units = newarray;
ng_fec_units_len = newlen;
}
@@ -333,7 +333,7 @@ ng_fec_free_unit(int unit)
*/
ng_units_in_use--;
if (ng_units_in_use == 0) { /* XXX make SMP safe */
- FREE(ng_fec_units, M_NETGRAPH);
+ free(ng_fec_units, M_NETGRAPH);
ng_fec_units_len = 0;
ng_fec_units = NULL;
}
@@ -403,8 +403,7 @@ ng_fec_addport(struct ng_fec_private *priv, char *iface)
}
/* Allocate new list entry. */
- MALLOC(new, struct ng_fec_portlist *,
- sizeof(struct ng_fec_portlist), M_NETGRAPH, M_NOWAIT);
+ new = malloc( sizeof(struct ng_fec_portlist), M_NETGRAPH, M_NOWAIT);
if (new == NULL)
return(ENOMEM);
@@ -511,7 +510,7 @@ ng_fec_delport(struct ng_fec_private *priv, char *iface)
/* Delete port */
TAILQ_REMOVE(&b->ng_fec_ports, p, fec_list);
- FREE(p, M_NETGRAPH);
+ free(p, M_NETGRAPH);
b->fec_ifcnt--;
if (b->fec_ifcnt == 0)
@@ -1196,13 +1195,13 @@ ng_fec_constructor(node_p node)
int error = 0;
/* Allocate node and interface private structures */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
+ priv = malloc(sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
if (priv == NULL)
return (ENOMEM);
ifp = priv->ifp = if_alloc(IFT_ETHER);
if (ifp == NULL) {
- FREE(priv, M_NETGRAPH);
+ free(priv, M_NETGRAPH);
return (ENOSPC);
}
b = &priv->fec_bundle;
@@ -1213,7 +1212,7 @@ ng_fec_constructor(node_p node)
/* Get an interface unit number */
if ((error = ng_fec_get_unit(&priv->unit)) != 0) {
if_free(ifp);
- FREE(priv, M_NETGRAPH);
+ free(priv, M_NETGRAPH);
return (error);
}
@@ -1337,7 +1336,7 @@ ng_fec_shutdown(node_p node)
if_free_type(priv->ifp, IFT_ETHER);
ifmedia_removeall(&priv->ifmedia);
ng_fec_free_unit(priv->unit);
- FREE(priv, M_NETGRAPH);
+ free(priv, M_NETGRAPH);
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(node);
return (0);
diff --git a/sys/netgraph/ng_frame_relay.c b/sys/netgraph/ng_frame_relay.c
index 406de6912f7e..599e80ee310b 100644
--- a/sys/netgraph/ng_frame_relay.c
+++ b/sys/netgraph/ng_frame_relay.c
@@ -212,7 +212,7 @@ ngfrm_constructor(node_p node)
{
sc_p sc;
- MALLOC(sc, sc_p, sizeof(*sc), M_NETGRAPH, M_NOWAIT | M_ZERO);
+ sc = malloc(sizeof(*sc), M_NETGRAPH, M_NOWAIT | M_ZERO);
if (!sc)
return (ENOMEM);
sc->addrlen = 2; /* default */
@@ -481,7 +481,7 @@ ngfrm_shutdown(node_p node)
const sc_p sc = NG_NODE_PRIVATE(node);
NG_NODE_SET_PRIVATE(node, NULL);
- FREE(sc, M_NETGRAPH);
+ free(sc, M_NETGRAPH);
NG_NODE_UNREF(node);
return (0);
}
diff --git a/sys/netgraph/ng_gif.c b/sys/netgraph/ng_gif.c
index 96113d282c05..22d085a2bc04 100644
--- a/sys/netgraph/ng_gif.c
+++ b/sys/netgraph/ng_gif.c
@@ -241,7 +241,7 @@ ng_gif_attach(struct ifnet *ifp)
}
/* Allocate private data */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
+ priv = malloc(sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
if (priv == NULL) {
log(LOG_ERR, "%s: can't %s for %s\n",
__func__, "allocate memory", ifp->if_xname);
@@ -503,7 +503,7 @@ ng_gif_shutdown(node_p node)
* Assume the ifp has already been freed.
*/
NG_NODE_SET_PRIVATE(node, NULL);
- FREE(priv, M_NETGRAPH);
+ free(priv, M_NETGRAPH);
NG_NODE_UNREF(node); /* free node itself */
return (0);
}
diff --git a/sys/netgraph/ng_gif_demux.c b/sys/netgraph/ng_gif_demux.c
index 1c5c43a57135..a5ac5e149a40 100644
--- a/sys/netgraph/ng_gif_demux.c
+++ b/sys/netgraph/ng_gif_demux.c
@@ -233,7 +233,7 @@ ng_gif_demux_constructor(node_p node)
priv_p priv;
/* Allocate and initialize private info */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH_GIF_DEMUX,
+ priv = malloc(sizeof(*priv), M_NETGRAPH_GIF_DEMUX,
M_NOWAIT | M_ZERO);
if (priv == NULL)
return (ENOMEM);
@@ -371,7 +371,7 @@ ng_gif_demux_shutdown(node_p node)
{
const priv_p priv = NG_NODE_PRIVATE(node);
- FREE(priv, M_NETGRAPH_GIF_DEMUX);
+ free(priv, M_NETGRAPH_GIF_DEMUX);
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(node);
return (0);
diff --git a/sys/netgraph/ng_hole.c b/sys/netgraph/ng_hole.c
index f3b8f8c2f0e7..508ff1327d6a 100644
--- a/sys/netgraph/ng_hole.c
+++ b/sys/netgraph/ng_hole.c
@@ -132,7 +132,7 @@ ngh_newhook(node_p node, hook_p hook, const char *name)
hinfo_p hip;
/* Create hook private structure. */
- MALLOC(hip, hinfo_p, sizeof(*hip), M_NETGRAPH, M_NOWAIT | M_ZERO);
+ hip = malloc(sizeof(*hip), M_NETGRAPH, M_NOWAIT | M_ZERO);
if (hip == NULL)
return (ENOMEM);
NG_HOOK_SET_PRIVATE(hook, hip);
@@ -219,7 +219,7 @@ static int
ngh_disconnect(hook_p hook)
{
- FREE(NG_HOOK_PRIVATE(hook), M_NETGRAPH);
+ free(NG_HOOK_PRIVATE(hook), M_NETGRAPH);
NG_HOOK_SET_PRIVATE(hook, NULL);
if (NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0)
ng_rmnode_self(NG_HOOK_NODE(hook));
diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c
index b216bfc0a505..e86dfc8c8e27 100644
--- a/sys/netgraph/ng_iface.c
+++ b/sys/netgraph/ng_iface.c
@@ -511,12 +511,12 @@ ng_iface_constructor(node_p node)
priv_p priv;
/* Allocate node and interface private structures */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH_IFACE, M_NOWAIT|M_ZERO);
+ priv = malloc(sizeof(*priv), M_NETGRAPH_IFACE, M_NOWAIT|M_ZERO);
if (priv == NULL)
return (ENOMEM);
ifp = if_alloc(IFT_PROPVIRTUAL);
if (ifp == NULL) {
- FREE(priv, M_NETGRAPH_IFACE);
+ free(priv, M_NETGRAPH_IFACE);
return (ENOMEM);
}
@@ -781,7 +781,7 @@ ng_iface_shutdown(node_p node)
CURVNET_RESTORE();
priv->ifp = NULL;
free_unr(V_ng_iface_unit, priv->unit);
- FREE(priv, M_NETGRAPH_IFACE);
+ free(priv, M_NETGRAPH_IFACE);
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(node);
return (0);
diff --git a/sys/netgraph/ng_ipfw.c b/sys/netgraph/ng_ipfw.c
index f7c66623aa08..91af21528305 100644
--- a/sys/netgraph/ng_ipfw.c
+++ b/sys/netgraph/ng_ipfw.c
@@ -162,7 +162,7 @@ ng_ipfw_newhook(node_p node, hook_p hook, const char *name)
return (EINVAL);
/* Allocate memory for this hook's private data */
- MALLOC(hpriv, hpriv_p, sizeof(*hpriv), M_NETGRAPH, M_NOWAIT | M_ZERO);
+ hpriv = malloc(sizeof(*hpriv), M_NETGRAPH, M_NOWAIT | M_ZERO);
if (hpriv== NULL)
return (ENOMEM);
@@ -331,7 +331,7 @@ ng_ipfw_disconnect(hook_p hook)
{
const hpriv_p hpriv = NG_HOOK_PRIVATE(hook);
- FREE(hpriv, M_NETGRAPH);
+ free(hpriv, M_NETGRAPH);
NG_HOOK_SET_PRIVATE(hook, NULL);
return (0);
diff --git a/sys/netgraph/ng_ksocket.c b/sys/netgraph/ng_ksocket.c
index 43364f194ddf..312b5ef61a04 100644
--- a/sys/netgraph/ng_ksocket.c
+++ b/sys/netgraph/ng_ksocket.c
@@ -250,17 +250,17 @@ ng_ksocket_sockaddr_parse(const struct ng_parse_type *type,
return (EINVAL);
pathlen = strlen(path);
if (pathlen > SOCK_MAXADDRLEN) {
- FREE(path, M_NETGRAPH_KSOCKET);
+ free(path, M_NETGRAPH_KSOCKET);
return (E2BIG);
}
if (*buflen < pathoff + pathlen) {
- FREE(path, M_NETGRAPH_KSOCKET);
+ free(path, M_NETGRAPH_KSOCKET);
return (ERANGE);
}
*off += toklen;
bcopy(path, sun->sun_path, pathlen);
sun->sun_len = pathoff + pathlen;
- FREE(path, M_NETGRAPH_KSOCKET);
+ free(path, M_NETGRAPH_KSOCKET);
break;
}
@@ -335,7 +335,7 @@ ng_ksocket_sockaddr_unparse(const struct ng_parse_type *type,
if ((pathtoken = ng_encode_string(pathbuf, pathlen)) == NULL)
return (ENOMEM);
slen += snprintf(cbuf, cbuflen, "local/%s", pathtoken);
- FREE(pathtoken, M_NETGRAPH_KSOCKET);
+ free(pathtoken, M_NETGRAPH_KSOCKET);
if (slen >= cbuflen)
return (ERANGE);
*off += sun->sun_len;
@@ -523,7 +523,7 @@ ng_ksocket_constructor(node_p node)
priv_p priv;
/* Allocate private structure */
- MALLOC(priv, priv_p, sizeof(*priv),
+ priv = malloc(sizeof(*priv),
M_NETGRAPH_KSOCKET, M_NOWAIT | M_ZERO);
if (priv == NULL)
return (ENOMEM);
@@ -811,7 +811,7 @@ ng_ksocket_rcvmsg(node_p node, item_p item, hook_p lasthook)
bail:
/* Cleanup */
if (sa != NULL)
- FREE(sa, M_SONAME);
+ free(sa, M_SONAME);
break;
}
@@ -965,7 +965,7 @@ ng_ksocket_shutdown(node_p node)
/* Take down netgraph node */
bzero(priv, sizeof(*priv));
- FREE(priv, M_NETGRAPH_KSOCKET);
+ free(priv, M_NETGRAPH_KSOCKET);
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(node); /* let the node escape */
return (0);
@@ -1105,7 +1105,7 @@ ng_ksocket_incoming2(node_p node, hook_p hook, void *arg1, int arg2)
/* See if we got anything */
if (m == NULL) {
if (sa != NULL)
- FREE(sa, M_SONAME);
+ free(sa, M_SONAME);
break;
}
@@ -1130,11 +1130,11 @@ ng_ksocket_incoming2(node_p node, hook_p hook, void *arg1, int arg2)
NG_KSOCKET_TAG_SOCKADDR, sizeof(ng_ID_t) +
sa->sa_len, M_NOWAIT);
if (stag == NULL) {
- FREE(sa, M_SONAME);
+ free(sa, M_SONAME);
goto sendit;
}
bcopy(sa, &stag->sa, sa->sa_len);
- FREE(sa, M_SONAME);
+ free(sa, M_SONAME);
stag->id = NG_NODE_ID(node);
m_tag_prepend(m, &stag->tag);
}
@@ -1234,14 +1234,14 @@ ng_ksocket_finish_accept(priv_p priv)
/* Clone a ksocket node to wrap the new socket */
error = ng_make_node_common(&ng_ksocket_typestruct, &node);
if (error) {
- FREE(resp, M_NETGRAPH);
+ free(resp, M_NETGRAPH);
soclose(so);
goto out;
}
if (ng_ksocket_constructor(node) != 0) {
NG_NODE_UNREF(node);
- FREE(resp, M_NETGRAPH);
+ free(resp, M_NETGRAPH);
soclose(so);
goto out;
}
@@ -1276,7 +1276,7 @@ ng_ksocket_finish_accept(priv_p priv)
out:
if (sa != NULL)
- FREE(sa, M_SONAME);
+ free(sa, M_SONAME);
}
/*
diff --git a/sys/netgraph/ng_l2tp.c b/sys/netgraph/ng_l2tp.c
index f035bea184b4..46a817cfadf8 100644
--- a/sys/netgraph/ng_l2tp.c
+++ b/sys/netgraph/ng_l2tp.c
@@ -364,7 +364,7 @@ ng_l2tp_constructor(node_p node)
int i;
/* Allocate private structure */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH_L2TP, M_NOWAIT | M_ZERO);
+ priv = malloc(sizeof(*priv), M_NETGRAPH_L2TP, M_NOWAIT | M_ZERO);
if (priv == NULL)
return (ENOMEM);
NG_NODE_SET_PRIVATE(node, priv);
@@ -428,8 +428,7 @@ ng_l2tp_newhook(node_p node, hook_p hook, const char *name)
return (EINVAL);
/* Create hook private structure */
- MALLOC(hpriv, hookpriv_p,
- sizeof(*hpriv), M_NETGRAPH_L2TP, M_NOWAIT | M_ZERO);
+ hpriv = malloc( sizeof(*hpriv), M_NETGRAPH_L2TP, M_NOWAIT | M_ZERO);
if (hpriv == NULL)
return (ENOMEM);
hpriv->conf.session_id = session_id;
@@ -667,7 +666,7 @@ ng_l2tp_shutdown(node_p node)
mtx_destroy(&seq->mtx);
- FREE(priv, M_NETGRAPH_L2TP);
+ free(priv, M_NETGRAPH_L2TP);
/* Unref node */
NG_NODE_UNREF(node);
@@ -691,7 +690,7 @@ ng_l2tp_disconnect(hook_p hook)
else {
const hookpriv_p hpriv = NG_HOOK_PRIVATE(hook);
LIST_REMOVE(hpriv, sessions);
- FREE(hpriv, M_NETGRAPH_L2TP);
+ free(hpriv, M_NETGRAPH_L2TP);
NG_HOOK_SET_PRIVATE(hook, NULL);
}
diff --git a/sys/netgraph/ng_lmi.c b/sys/netgraph/ng_lmi.c
index 105ba7e6f83e..9de32ce0551f 100644
--- a/sys/netgraph/ng_lmi.c
+++ b/sys/netgraph/ng_lmi.c
@@ -185,7 +185,7 @@ nglmi_constructor(node_p node)
{
sc_p sc;
- MALLOC(sc, sc_p, sizeof(*sc), M_NETGRAPH, M_NOWAIT | M_ZERO);
+ sc = malloc(sizeof(*sc), M_NETGRAPH, M_NOWAIT | M_ZERO);
if (sc == NULL)
return (ENOMEM);
@@ -1053,7 +1053,7 @@ nglmi_shutdown(node_p node)
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(sc->node);
- FREE(sc, M_NETGRAPH);
+ free(sc, M_NETGRAPH);
return (0);
}
diff --git a/sys/netgraph/ng_message.h b/sys/netgraph/ng_message.h
index 7d0f4d8e59fa..819397ad4271 100644
--- a/sys/netgraph/ng_message.h
+++ b/sys/netgraph/ng_message.h
@@ -388,7 +388,7 @@ struct flow_manager {
*/
#define NG_MKMESSAGE(msg, cookie, cmdid, len, how) \
do { \
- MALLOC((msg), struct ng_mesg *, sizeof(struct ng_mesg) \
+ (msg) = malloc(sizeof(struct ng_mesg) \
+ (len), M_NETGRAPH_MSG, (how) | M_ZERO); \
if ((msg) == NULL) \
break; \
@@ -406,7 +406,7 @@ struct flow_manager {
*/
#define NG_MKRESPONSE(rsp, msg, len, how) \
do { \
- MALLOC((rsp), struct ng_mesg *, sizeof(struct ng_mesg) \
+ (rsp) = malloc(sizeof(struct ng_mesg) \
+ (len), M_NETGRAPH_MSG, (how) | M_ZERO); \
if ((rsp) == NULL) \
break; \
@@ -425,8 +425,8 @@ struct flow_manager {
*/
#define NG_COPYMESSAGE(copy, msg, how) \
do { \
- MALLOC((copy), struct ng_mesg *, sizeof(struct ng_mesg) + \
- (msg)->header.arglen, M_NETGRAPH_MSG, (how) | M_ZERO); \
+ (copy) = malloc(sizeof(struct ng_mesg) \
+ + (msg)->header.arglen, M_NETGRAPH_MSG, (how) | M_ZERO); \
if ((copy) == NULL) \
break; \
(copy)->header.version = NG_VERSION; \
diff --git a/sys/netgraph/ng_mppc.c b/sys/netgraph/ng_mppc.c
index 0cf1e7272b9a..2a7198f99317 100644
--- a/sys/netgraph/ng_mppc.c
+++ b/sys/netgraph/ng_mppc.c
@@ -200,7 +200,7 @@ ng_mppc_constructor(node_p node)
priv_p priv;
/* Allocate private structure */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH_MPPC, M_NOWAIT | M_ZERO);
+ priv = malloc(sizeof(*priv), M_NETGRAPH_MPPC, M_NOWAIT | M_ZERO);
if (priv == NULL)
return (ENOMEM);
@@ -291,12 +291,11 @@ ng_mppc_rcvmsg(node_p node, item_p item, hook_p lasthook)
#ifdef NETGRAPH_MPPC_COMPRESSION
/* Initialize state buffers for compression */
if (d->history != NULL) {
- FREE(d->history, M_NETGRAPH_MPPC);
+ free(d->history, M_NETGRAPH_MPPC);
d->history = NULL;
}
if ((cfg->bits & MPPC_BIT) != 0) {
- MALLOC(d->history, u_char *,
- isComp ? MPPC_SizeOfCompressionHistory() :
+ d->history = malloc( isComp ? MPPC_SizeOfCompressionHistory() :
MPPC_SizeOfDecompressionHistory(),
M_NETGRAPH_MPPC, M_NOWAIT);
if (d->history == NULL)
@@ -421,12 +420,12 @@ ng_mppc_shutdown(node_p node)
/* Take down netgraph node */
#ifdef NETGRAPH_MPPC_COMPRESSION
if (priv->xmit.history != NULL)
- FREE(priv->xmit.history, M_NETGRAPH_MPPC);
+ free(priv->xmit.history, M_NETGRAPH_MPPC);
if (priv->recv.history != NULL)
- FREE(priv->recv.history, M_NETGRAPH_MPPC);
+ free(priv->recv.history, M_NETGRAPH_MPPC);
#endif
bzero(priv, sizeof(*priv));
- FREE(priv, M_NETGRAPH_MPPC);
+ free(priv, M_NETGRAPH_MPPC);
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(node); /* let the node escape */
return (0);
diff --git a/sys/netgraph/ng_nat.c b/sys/netgraph/ng_nat.c
index 9e605daafd13..cc69b141e027 100644
--- a/sys/netgraph/ng_nat.c
+++ b/sys/netgraph/ng_nat.c
@@ -272,7 +272,7 @@ ng_nat_constructor(node_p node)
priv_p priv;
/* Initialize private descriptor. */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH,
+ priv = malloc(sizeof(*priv), M_NETGRAPH,
M_NOWAIT | M_ZERO);
if (priv == NULL)
return (ENOMEM);
@@ -280,7 +280,7 @@ ng_nat_constructor(node_p node)
/* Init aliasing engine. */
priv->lib = LibAliasInit(NULL);
if (priv->lib == NULL) {
- FREE(priv, M_NETGRAPH);
+ free(priv, M_NETGRAPH);
return (ENOMEM);
}
@@ -408,7 +408,7 @@ ng_nat_rcvmsg(node_p node, item_p item, hook_p lasthook)
if (entry->lnk == NULL) {
error = ENOMEM;
- FREE(entry, M_NETGRAPH);
+ free(entry, M_NETGRAPH);
break;
}
@@ -464,7 +464,7 @@ ng_nat_rcvmsg(node_p node, item_p item, hook_p lasthook)
if (entry->lnk == NULL) {
error = ENOMEM;
- FREE(entry, M_NETGRAPH);
+ free(entry, M_NETGRAPH);
break;
}
@@ -517,7 +517,7 @@ ng_nat_rcvmsg(node_p node, item_p item, hook_p lasthook)
if (entry->lnk == NULL) {
error = ENOMEM;
- FREE(entry, M_NETGRAPH);
+ free(entry, M_NETGRAPH);
break;
}
@@ -583,7 +583,7 @@ ng_nat_rcvmsg(node_p node, item_p item, hook_p lasthook)
/* Delete entry from our internal list. */
priv->rdrcount--;
STAILQ_REMOVE(&priv->redirhead, entry, ng_nat_rdr_lst, entries);
- FREE(entry, M_NETGRAPH);
+ free(entry, M_NETGRAPH);
}
break;
case NGM_NAT_ADD_SERVER:
@@ -785,12 +785,12 @@ ng_nat_shutdown(node_p node)
while (!STAILQ_EMPTY(&priv->redirhead)) {
struct ng_nat_rdr_lst *entry = STAILQ_FIRST(&priv->redirhead);
STAILQ_REMOVE_HEAD(&priv->redirhead, entries);
- FREE(entry, M_NETGRAPH);
+ free(entry, M_NETGRAPH);
};
/* Final free. */
LibAliasUninit(priv->lib);
- FREE(priv, M_NETGRAPH);
+ free(priv, M_NETGRAPH);
return (0);
}
diff --git a/sys/netgraph/ng_one2many.c b/sys/netgraph/ng_one2many.c
index ca742b3dc959..6b887306715a 100644
--- a/sys/netgraph/ng_one2many.c
+++ b/sys/netgraph/ng_one2many.c
@@ -187,7 +187,7 @@ ng_one2many_constructor(node_p node)
priv_p priv;
/* Allocate and initialize private info */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
+ priv = malloc(sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
if (priv == NULL)
return (ENOMEM);
priv->conf.xmitAlg = NG_ONE2MANY_XMIT_ROUNDROBIN;
@@ -501,7 +501,7 @@ ng_one2many_shutdown(node_p node)
KASSERT(priv->numActiveMany == 0,
("%s: numActiveMany=%d", __func__, priv->numActiveMany));
- FREE(priv, M_NETGRAPH);
+ free(priv, M_NETGRAPH);
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(node);
return (0);
diff --git a/sys/netgraph/ng_parse.c b/sys/netgraph/ng_parse.c
index 2c46d5c7881d..1215df124b5e 100644
--- a/sys/netgraph/ng_parse.c
+++ b/sys/netgraph/ng_parse.c
@@ -740,7 +740,7 @@ ng_string_parse(const struct ng_parse_type *type,
return (EINVAL);
*off += len;
bcopy(sval, buf, slen + 1);
- FREE(sval, M_NETGRAPH_PARSE);
+ free(sval, M_NETGRAPH_PARSE);
*buflen = slen + 1;
return (0);
}
@@ -756,11 +756,11 @@ ng_string_unparse(const struct ng_parse_type *type,
if (s == NULL)
return (ENOMEM);
if ((error = ng_parse_append(&cbuf, &cbuflen, "%s", s)) != 0) {
- FREE(s, M_NETGRAPH_PARSE);
+ free(s, M_NETGRAPH_PARSE);
return (error);
}
*off += strlen(raw) + 1;
- FREE(s, M_NETGRAPH_PARSE);
+ free(s, M_NETGRAPH_PARSE);
return (0);
}
@@ -803,12 +803,12 @@ ng_fixedstring_parse(const struct ng_parse_type *type,
if ((sval = ng_get_string_token(s, off, &len, &slen)) == NULL)
return (EINVAL);
if (slen + 1 > fi->bufSize) {
- FREE(sval, M_NETGRAPH_PARSE);
+ free(sval, M_NETGRAPH_PARSE);
return (E2BIG);
}
*off += len;
bcopy(sval, buf, slen);
- FREE(sval, M_NETGRAPH_PARSE);
+ free(sval, M_NETGRAPH_PARSE);
bzero(buf + slen, fi->bufSize - slen);
*buflen = fi->bufSize;
return (0);
@@ -906,13 +906,13 @@ ng_sizedstring_parse(const struct ng_parse_type *type,
if ((sval = ng_get_string_token(s, off, &len, &slen)) == NULL)
return (EINVAL);
if (slen > USHRT_MAX) {
- FREE(sval, M_NETGRAPH_PARSE);
+ free(sval, M_NETGRAPH_PARSE);
return (EINVAL);
}
*off += len;
*((u_int16_t *)buf) = (u_int16_t)slen;
bcopy(sval, buf + 2, slen);
- FREE(sval, M_NETGRAPH_PARSE);
+ free(sval, M_NETGRAPH_PARSE);
*buflen = 2 + slen;
return (0);
}
@@ -929,10 +929,10 @@ ng_sizedstring_unparse(const struct ng_parse_type *type,
if (s == NULL)
return (ENOMEM);
if ((error = ng_parse_append(&cbuf, &cbuflen, "%s", s)) != 0) {
- FREE(s, M_NETGRAPH_PARSE);
+ free(s, M_NETGRAPH_PARSE);
return (error);
}
- FREE(s, M_NETGRAPH_PARSE);
+ free(s, M_NETGRAPH_PARSE);
*off += slen + 2;
return (0);
}
@@ -1117,16 +1117,16 @@ ng_bytearray_parse(const struct ng_parse_type *type,
arraylen = (*getLength)(type, start, buf);
if (arraylen > *buflen) {
- FREE(str, M_NETGRAPH_PARSE);
+ free(str, M_NETGRAPH_PARSE);
return (ERANGE);
}
if (slen > arraylen) {
- FREE(str, M_NETGRAPH_PARSE);
+ free(str, M_NETGRAPH_PARSE);
return (E2BIG);
}
bcopy(str, buf, slen);
bzero(buf + slen, arraylen - slen);
- FREE(str, M_NETGRAPH_PARSE);
+ free(str, M_NETGRAPH_PARSE);
*off += toklen;
*buflen = arraylen;
return (0);
@@ -1219,7 +1219,7 @@ ng_parse_composite(const struct ng_parse_type *type, const char *s,
int align, len, blen, error = 0;
/* Initialize */
- MALLOC(foff, int *, num * sizeof(*foff), M_NETGRAPH_PARSE, M_NOWAIT | M_ZERO);
+ foff = malloc(num * sizeof(*foff), M_NETGRAPH_PARSE, M_NOWAIT | M_ZERO);
if (foff == NULL) {
error = ENOMEM;
goto done;
@@ -1375,7 +1375,7 @@ gotIndex:
*buflen = blen;
done:
if (foff != NULL)
- FREE(foff, M_NETGRAPH_PARSE);
+ free(foff, M_NETGRAPH_PARSE);
return (error);
}
@@ -1395,7 +1395,7 @@ ng_unparse_composite(const struct ng_parse_type *type, const u_char *data,
u_char *workBuf;
/* Get workspace for checking default values */
- MALLOC(workBuf, u_char *, workSize, M_NETGRAPH_PARSE, M_NOWAIT);
+ workBuf = malloc(workSize, M_NETGRAPH_PARSE, M_NOWAIT);
if (workBuf == NULL)
return (ENOMEM);
@@ -1453,7 +1453,7 @@ ng_unparse_composite(const struct ng_parse_type *type, const u_char *data,
/* Print value */
if ((error = INVOKE(etype, unparse)
(etype, data, off, cbuf, cbuflen)) != 0) {
- FREE(workBuf, M_NETGRAPH_PARSE);
+ free(workBuf, M_NETGRAPH_PARSE);
return (error);
}
cbuflen -= strlen(cbuf);
@@ -1467,7 +1467,7 @@ ng_unparse_composite(const struct ng_parse_type *type, const u_char *data,
fail:
/* Clean up after failure */
- FREE(workBuf, M_NETGRAPH_PARSE);
+ free(workBuf, M_NETGRAPH_PARSE);
return (error);
}
@@ -1717,7 +1717,7 @@ ng_parse_get_token(const char *s, int *startp, int *lenp)
case '"':
if ((t = ng_get_string_token(s, startp, lenp, NULL)) == NULL)
return T_ERROR;
- FREE(t, M_NETGRAPH_PARSE);
+ free(t, M_NETGRAPH_PARSE);
return T_STRING;
default:
for (i = *startp + 1; s[i] != '\0' && !isspace(s[i])
@@ -1745,7 +1745,7 @@ ng_get_string_token(const char *s, int *startp, int *lenp, int *slenp)
start = *startp;
if (s[*startp] != '"')
return (NULL);
- MALLOC(cbuf, char *, strlen(s + start), M_NETGRAPH_PARSE, M_NOWAIT);
+ cbuf = malloc(strlen(s + start), M_NETGRAPH_PARSE, M_NOWAIT);
if (cbuf == NULL)
return (NULL);
strcpy(cbuf, s + start + 1);
@@ -1812,7 +1812,7 @@ ng_get_string_token(const char *s, int *startp, int *lenp, int *slenp)
strcpy(p, v);
}
}
- FREE(cbuf, M_NETGRAPH_PARSE);
+ free(cbuf, M_NETGRAPH_PARSE);
return (NULL); /* no closing quote */
}
@@ -1828,7 +1828,7 @@ ng_encode_string(const char *raw, int slen)
int off = 0;
int i;
- MALLOC(cbuf, char *, strlen(raw) * 4 + 3, M_NETGRAPH_PARSE, M_NOWAIT);
+ cbuf = malloc(strlen(raw) * 4 + 3, M_NETGRAPH_PARSE, M_NOWAIT);
if (cbuf == NULL)
return (NULL);
cbuf[off++] = '"';
diff --git a/sys/netgraph/ng_pipe.c b/sys/netgraph/ng_pipe.c
index 071927a24456..b12318a1a4c9 100644
--- a/sys/netgraph/ng_pipe.c
+++ b/sys/netgraph/ng_pipe.c
@@ -261,7 +261,7 @@ ngp_constructor(node_p node)
{
priv_p priv;
- MALLOC(priv, priv_p, sizeof(*priv), M_NG_PIPE, M_ZERO | M_NOWAIT);
+ priv = malloc(sizeof(*priv), M_NG_PIPE, M_ZERO | M_NOWAIT);
if (priv == NULL)
return (ENOMEM);
NG_NODE_SET_PRIVATE(node, priv);
@@ -439,7 +439,7 @@ parse_cfg(struct ng_pipe_hookcfg *current, struct ng_pipe_hookcfg *new,
if (new->ber == -1) {
current->ber = 0;
if (hinfo->ber_p) {
- FREE(hinfo->ber_p, M_NG_PIPE);
+ free(hinfo->ber_p, M_NG_PIPE);
hinfo->ber_p = NULL;
}
} else if (new->ber >= 1 && new->ber <= 1000000000000) {
@@ -448,7 +448,7 @@ parse_cfg(struct ng_pipe_hookcfg *current, struct ng_pipe_hookcfg *new,
uint32_t fsize, i;
if (hinfo->ber_p == NULL)
- MALLOC(hinfo->ber_p, uint64_t *, \
+ hinfo->ber_p = malloc(\
(MAX_FSIZE + MAX_OHSIZE)*sizeof(uint64_t), \
M_NG_PIPE, M_NOWAIT);
current->ber = new->ber;
@@ -959,7 +959,7 @@ ngp_shutdown(node_p node)
ng_rmhook_self(priv->lower.hook);
}
NG_NODE_UNREF(node);
- FREE(priv, M_NG_PIPE);
+ free(priv, M_NG_PIPE);
return (0);
}
@@ -1014,7 +1014,7 @@ ngp_disconnect(hook_p hook)
/* Release the packet loss probability table (BER) */
if (hinfo->ber_p)
- FREE(hinfo->ber_p, M_NG_PIPE);
+ free(hinfo->ber_p, M_NG_PIPE);
mtx_unlock(&ng_pipe_giant);
diff --git a/sys/netgraph/ng_ppp.c b/sys/netgraph/ng_ppp.c
index b83b78f191e8..ec5d62bd0754 100644
--- a/sys/netgraph/ng_ppp.c
+++ b/sys/netgraph/ng_ppp.c
@@ -490,7 +490,7 @@ ng_ppp_constructor(node_p node)
int i;
/* Allocate private structure */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH_PPP, M_NOWAIT | M_ZERO);
+ priv = malloc(sizeof(*priv), M_NETGRAPH_PPP, M_NOWAIT | M_ZERO);
if (priv == NULL)
return (ENOMEM);
@@ -743,7 +743,7 @@ ng_ppp_shutdown(node_p node)
mtx_destroy(&priv->rmtx);
mtx_destroy(&priv->xmtx);
bzero(priv, sizeof(*priv));
- FREE(priv, M_NETGRAPH_PPP);
+ free(priv, M_NETGRAPH_PPP);
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(node); /* let the node escape */
return (0);
diff --git a/sys/netgraph/ng_pptpgre.c b/sys/netgraph/ng_pptpgre.c
index bb7a58976d65..5c5d12800645 100644
--- a/sys/netgraph/ng_pptpgre.c
+++ b/sys/netgraph/ng_pptpgre.c
@@ -280,7 +280,7 @@ ng_pptpgre_constructor(node_p node)
int i;
/* Allocate private structure */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
+ priv = malloc(sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
if (priv == NULL)
return (ENOMEM);
@@ -519,7 +519,7 @@ ng_pptpgre_shutdown(node_p node)
LIST_REMOVE(&priv->uppersess, sessions);
mtx_destroy(&priv->uppersess.mtx);
- FREE(priv, M_NETGRAPH);
+ free(priv, M_NETGRAPH);
/* Decrement ref count */
NG_NODE_UNREF(node);
diff --git a/sys/netgraph/ng_rfc1490.c b/sys/netgraph/ng_rfc1490.c
index 52a89a3adfeb..99f8641cdd45 100644
--- a/sys/netgraph/ng_rfc1490.c
+++ b/sys/netgraph/ng_rfc1490.c
@@ -165,7 +165,7 @@ ng_rfc1490_constructor(node_p node)
priv_p priv;
/* Allocate private structure */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
+ priv = malloc(sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
if (priv == NULL)
return (ENOMEM);
@@ -459,7 +459,7 @@ ng_rfc1490_shutdown(node_p node)
/* Take down netgraph node */
bzero(priv, sizeof(*priv));
- FREE(priv, M_NETGRAPH);
+ free(priv, M_NETGRAPH);
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(node); /* let the node escape */
return (0);
diff --git a/sys/netgraph/ng_sample.c b/sys/netgraph/ng_sample.c
index 63b3f0be118f..38b86d3a8415 100644
--- a/sys/netgraph/ng_sample.c
+++ b/sys/netgraph/ng_sample.c
@@ -154,7 +154,7 @@ ng_xxx_constructor(node_p node)
int i;
/* Initialize private descriptor */
- MALLOC(privdata, xxx_p, sizeof(*privdata), M_NETGRAPH,
+ privdata = malloc(sizeof(*privdata), M_NETGRAPH,
M_NOWAIT | M_ZERO);
if (privdata == NULL)
return (ENOMEM);
@@ -424,7 +424,7 @@ ng_xxx_shutdown(node_p node)
#ifndef PERSISTANT_NODE
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(node);
- FREE(privdata, M_NETGRAPH);
+ free(privdata, M_NETGRAPH);
#else
if (node->nd_flags & NGF_REALLY_DIE) {
/*
@@ -434,7 +434,7 @@ ng_xxx_shutdown(node_p node)
*/
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(privdata->node);
- FREE(privdata, M_NETGRAPH);
+ free(privdata, M_NETGRAPH);
return (0);
}
NG_NODE_REVIVE(node); /* tell ng_rmnode() we will persist */
diff --git a/sys/netgraph/ng_split.c b/sys/netgraph/ng_split.c
index b7168f4224f2..b4f2ee0e88e7 100644
--- a/sys/netgraph/ng_split.c
+++ b/sys/netgraph/ng_split.c
@@ -85,7 +85,7 @@ ng_split_constructor(node_p node)
priv_p priv;
/* Allocate node */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_ZERO | M_NOWAIT);
+ priv = malloc(sizeof(*priv), M_NETGRAPH, M_ZERO | M_NOWAIT);
if (priv == NULL)
return (ENOMEM);
@@ -155,7 +155,7 @@ ng_split_shutdown(node_p node)
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(node);
- FREE(priv, M_NETGRAPH);
+ free(priv, M_NETGRAPH);
return (0);
}
diff --git a/sys/netgraph/ng_sppp.c b/sys/netgraph/ng_sppp.c
index 988de2e82f0e..5276f4f9becd 100644
--- a/sys/netgraph/ng_sppp.c
+++ b/sys/netgraph/ng_sppp.c
@@ -121,8 +121,8 @@ ng_sppp_get_unit (int *unit)
int newlen;
newlen = (2 * ng_sppp_units_len) + sizeof (*ng_sppp_units);
- MALLOC (newarray, unsigned char *,
- newlen * sizeof (*ng_sppp_units), M_NETGRAPH_SPPP, M_NOWAIT);
+ newarray = malloc (newlen * sizeof (*ng_sppp_units),
+ M_NETGRAPH_SPPP, M_NOWAIT);
if (newarray == NULL)
return (ENOMEM);
bcopy (ng_sppp_units, newarray,
@@ -130,7 +130,7 @@ ng_sppp_get_unit (int *unit)
bzero (newarray + ng_sppp_units_len,
newlen - ng_sppp_units_len);
if (ng_sppp_units != NULL)
- FREE (ng_sppp_units, M_NETGRAPH_SPPP);
+ free (ng_sppp_units, M_NETGRAPH_SPPP);
ng_sppp_units = newarray;
ng_sppp_units_len = newlen;
}
@@ -163,7 +163,7 @@ ng_sppp_free_unit (int unit)
ng_units_in_use--;
if (ng_units_in_use == 0) {
- FREE (ng_sppp_units, M_NETGRAPH_SPPP);
+ free (ng_sppp_units, M_NETGRAPH_SPPP);
ng_sppp_units_len = 0;
ng_sppp_units = NULL;
}
@@ -248,13 +248,13 @@ ng_sppp_constructor (node_p node)
int error = 0;
/* Allocate node and interface private structures */
- MALLOC (priv, priv_p, sizeof(*priv), M_NETGRAPH_SPPP, M_NOWAIT|M_ZERO);
+ priv = malloc (sizeof(*priv), M_NETGRAPH_SPPP, M_NOWAIT|M_ZERO);
if (priv == NULL)
return (ENOMEM);
ifp = if_alloc(IFT_PPP);
if (ifp == NULL) {
- FREE (priv, M_NETGRAPH_SPPP);
+ free (priv, M_NETGRAPH_SPPP);
return (ENOSPC);
}
pp = IFP2SP(ifp);
@@ -265,8 +265,8 @@ ng_sppp_constructor (node_p node)
/* Get an interface unit number */
if ((error = ng_sppp_get_unit(&priv->unit)) != 0) {
- FREE (pp, M_NETGRAPH_SPPP);
- FREE (priv, M_NETGRAPH_SPPP);
+ free (pp, M_NETGRAPH_SPPP);
+ free (priv, M_NETGRAPH_SPPP);
return (error);
}
@@ -401,7 +401,7 @@ ng_sppp_shutdown (node_p node)
if_detach (priv->ifp);
if_free(priv->ifp);
ng_sppp_free_unit (priv->unit);
- FREE (priv, M_NETGRAPH_SPPP);
+ free (priv, M_NETGRAPH_SPPP);
NG_NODE_SET_PRIVATE (node, NULL);
NG_NODE_UNREF (node);
return (0);
diff --git a/sys/netgraph/ng_tag.c b/sys/netgraph/ng_tag.c
index 3fd908a2fd4f..b183285e93e5 100644
--- a/sys/netgraph/ng_tag.c
+++ b/sys/netgraph/ng_tag.c
@@ -303,7 +303,7 @@ ng_tag_newhook(node_p node, hook_p hook, const char *name)
int error;
/* Create hook private structure. */
- MALLOC(hip, hinfo_p, sizeof(*hip), M_NETGRAPH_TAG, M_WAITOK | M_ZERO);
+ hip = malloc(sizeof(*hip), M_NETGRAPH_TAG, M_WAITOK | M_ZERO);
/* M_WAITOK can't return NULL. */
NG_HOOK_SET_PRIVATE(hook, hip);
@@ -316,13 +316,13 @@ ng_tag_newhook(node_p node, hook_p hook, const char *name)
/* Attach the default IN data. */
if ((error = ng_tag_setdata_in(hook, &ng_tag_default_in)) != 0) {
- FREE(hip, M_NETGRAPH_TAG);
+ free(hip, M_NETGRAPH_TAG);
return (error);
}
/* Attach the default OUT data. */
if ((error = ng_tag_setdata_out(hook, &ng_tag_default_out)) != 0) {
- FREE(hip, M_NETGRAPH_TAG);
+ free(hip, M_NETGRAPH_TAG);
return (error);
}
@@ -621,9 +621,9 @@ ng_tag_disconnect(hook_p hook)
priv->hi_nonmatch = NULL;
}
- FREE(hip->in, M_NETGRAPH_TAG);
- FREE(hip->out, M_NETGRAPH_TAG);
- FREE(hip, M_NETGRAPH_TAG);
+ free(hip->in, M_NETGRAPH_TAG);
+ free(hip->out, M_NETGRAPH_TAG);
+ free(hip, M_NETGRAPH_TAG);
NG_HOOK_SET_PRIVATE(hook, NULL); /* for good measure */
if ((NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0) &&
(NG_NODE_IS_VALID(NG_HOOK_NODE(hook)))) {
@@ -648,13 +648,13 @@ ng_tag_setdata_in(hook_p hook, const struct ng_tag_hookin *hp0)
/* Make a copy of the tag values and data. */
size = NG_TAG_HOOKIN_SIZE(hp0->tag_len);
- MALLOC(hp, struct ng_tag_hookin *, size, M_NETGRAPH_TAG, M_WAITOK);
+ hp = malloc(size, M_NETGRAPH_TAG, M_WAITOK);
/* M_WAITOK can't return NULL. */
bcopy(hp0, hp, size);
/* Free previous tag, if any, and assign new one. */
if (hip->in != NULL)
- FREE(hip->in, M_NETGRAPH_TAG);
+ free(hip->in, M_NETGRAPH_TAG);
hip->in = hp;
/*
@@ -698,13 +698,13 @@ ng_tag_setdata_out(hook_p hook, const struct ng_tag_hookout *hp0)
/* Make a copy of the tag values and data. */
size = NG_TAG_HOOKOUT_SIZE(hp0->tag_len);
- MALLOC(hp, struct ng_tag_hookout *, size, M_NETGRAPH_TAG, M_WAITOK);
+ hp = malloc(size, M_NETGRAPH_TAG, M_WAITOK);
/* M_WAITOK can't return NULL. */
bcopy(hp0, hp, size);
/* Free previous tag, if any, and assign new one. */
if (hip->out != NULL)
- FREE(hip->out, M_NETGRAPH_TAG);
+ free(hip->out, M_NETGRAPH_TAG);
hip->out = hp;
/* Fill internal values from API structures. */
diff --git a/sys/netgraph/ng_tcpmss.c b/sys/netgraph/ng_tcpmss.c
index ac951e6a7fdd..bcc421a9e081 100644
--- a/sys/netgraph/ng_tcpmss.c
+++ b/sys/netgraph/ng_tcpmss.c
@@ -159,7 +159,7 @@ ng_tcpmss_newhook(node_p node, hook_p hook, const char *name)
{
hpriv_p priv;
- MALLOC(priv, hpriv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
+ priv = malloc(sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
if (priv == NULL)
return (ENOMEM);
@@ -371,7 +371,7 @@ ng_tcpmss_disconnect(hook_p hook)
priv->outHook = NULL;
}
- FREE(NG_HOOK_PRIVATE(hook), M_NETGRAPH);
+ free(NG_HOOK_PRIVATE(hook), M_NETGRAPH);
if (NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0)
ng_rmnode_self(NG_HOOK_NODE(hook));
diff --git a/sys/netgraph/ng_tee.c b/sys/netgraph/ng_tee.c
index 930dc6c34cf3..6ea1a4b2f32b 100644
--- a/sys/netgraph/ng_tee.c
+++ b/sys/netgraph/ng_tee.c
@@ -153,7 +153,7 @@ ng_tee_constructor(node_p node)
{
sc_p privdata;
- MALLOC(privdata, sc_p, sizeof(*privdata), M_NETGRAPH, M_NOWAIT|M_ZERO);
+ privdata = malloc(sizeof(*privdata), M_NETGRAPH, M_NOWAIT|M_ZERO);
if (privdata == NULL)
return (ENOMEM);
@@ -356,7 +356,7 @@ ng_tee_shutdown(node_p node)
const sc_p privdata = NG_NODE_PRIVATE(node);
NG_NODE_SET_PRIVATE(node, NULL);
- FREE(privdata, M_NETGRAPH);
+ free(privdata, M_NETGRAPH);
NG_NODE_UNREF(node);
return (0);
}
diff --git a/sys/netgraph/ng_tty.c b/sys/netgraph/ng_tty.c
index 2d2fa45c9cb6..7616489c2b0d 100644
--- a/sys/netgraph/ng_tty.c
+++ b/sys/netgraph/ng_tty.c
@@ -160,7 +160,7 @@ ngt_constructor(node_p node)
char name[sizeof(NG_TTY_NODE_TYPE) + 8];
/* Allocate private structure */
- MALLOC(sc, sc_p, sizeof(*sc), M_NETGRAPH, M_NOWAIT | M_ZERO);
+ sc = malloc(sizeof(*sc), M_NETGRAPH, M_NOWAIT | M_ZERO);
if (sc == NULL)
return (ENOMEM);
@@ -250,7 +250,7 @@ ngt_shutdown(node_p node)
IF_DRAIN(&sc->outq);
mtx_destroy(&(sc)->outq.ifq_mtx);
NG_NODE_UNREF(sc->node);
- FREE(sc, M_NETGRAPH);
+ free(sc, M_NETGRAPH);
return (0);
}
diff --git a/sys/netgraph/ng_vjc.c b/sys/netgraph/ng_vjc.c
index ec70956e923a..5714ac05f57e 100644
--- a/sys/netgraph/ng_vjc.c
+++ b/sys/netgraph/ng_vjc.c
@@ -243,7 +243,7 @@ ng_vjc_constructor(node_p node)
priv_p priv;
/* Allocate private structure */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
+ priv = malloc(sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
if (priv == NULL)
return (ENOMEM);
@@ -545,7 +545,7 @@ ng_vjc_shutdown(node_p node)
const priv_p priv = NG_NODE_PRIVATE(node);
bzero(priv, sizeof(*priv));
- FREE(priv, M_NETGRAPH);
+ free(priv, M_NETGRAPH);
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(node);
return (0);
diff --git a/sys/netgraph/ng_vlan.c b/sys/netgraph/ng_vlan.c
index cd57f7c9ec62..bd29929cae34 100644
--- a/sys/netgraph/ng_vlan.c
+++ b/sys/netgraph/ng_vlan.c
@@ -161,7 +161,7 @@ ng_vlan_constructor(node_p node)
priv_p priv;
int i;
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
+ priv = malloc(sizeof(*priv), M_NETGRAPH, M_NOWAIT | M_ZERO);
if (priv == NULL)
return (ENOMEM);
for (i = 0; i < HASHSIZE; i++)
@@ -241,7 +241,7 @@ ng_vlan_rcvmsg(node_p node, item_p item, hook_p lasthook)
break;
}
/* Create filter. */
- MALLOC(f, struct filter *, sizeof(*f),
+ f = malloc(sizeof(*f),
M_NETGRAPH, M_NOWAIT | M_ZERO);
if (f == NULL) {
error = ENOMEM;
@@ -273,7 +273,7 @@ ng_vlan_rcvmsg(node_p node, item_p item, hook_p lasthook)
NG_HOOK_SET_PRIVATE(hook, NULL);
LIST_REMOVE(f, next);
priv->nent--;
- FREE(f, M_NETGRAPH);
+ free(f, M_NETGRAPH);
break;
case NGM_VLAN_GET_TABLE:
NG_MKRESPONSE(resp, msg, sizeof(*t) +
@@ -438,7 +438,7 @@ ng_vlan_shutdown(node_p node)
NG_NODE_SET_PRIVATE(node, NULL);
NG_NODE_UNREF(node);
- FREE(priv, M_NETGRAPH);
+ free(priv, M_NETGRAPH);
return (0);
}
@@ -457,7 +457,7 @@ ng_vlan_disconnect(hook_p hook)
if ((f = NG_HOOK_PRIVATE(hook)) != NULL) {
LIST_REMOVE(f, next);
priv->nent--;
- FREE(f, M_NETGRAPH);
+ free(f, M_NETGRAPH);
}
}
NG_HOOK_SET_PRIVATE(hook, NULL);
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c
index 10bc50d713bb..d047abe75a8d 100644
--- a/sys/netinet/igmp.c
+++ b/sys/netinet/igmp.c
@@ -158,7 +158,7 @@ find_rti(struct ifnet *ifp)
return (rti);
}
}
- MALLOC(rti, struct router_info *, sizeof *rti, M_IGMP, M_NOWAIT);
+ rti = malloc(sizeof *rti, M_IGMP, M_NOWAIT);
if (rti == NULL) {
IGMP_PRINTF("[igmp.c, _find_rti] --> no memory for entry\n");
return (NULL);
diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c
index df841cba8108..16d92ce3ff2a 100644
--- a/sys/netinet/in_mcast.c
+++ b/sys/netinet/in_mcast.c
@@ -189,7 +189,7 @@ imo_join_source(struct ip_moptions *imo, size_t gidx, sockunion_t *src)
return (EADDRNOTAVAIL);
/* Do not sleep with inp lock held. */
- MALLOC(nims, struct in_msource *, sizeof(struct in_msource),
+ nims = malloc(sizeof(struct in_msource),
M_IPMSOURCE, M_NOWAIT | M_ZERO);
if (nims == NULL)
return (ENOBUFS);
@@ -220,7 +220,7 @@ imo_leave_source(struct ip_moptions *imo, size_t gidx, sockunion_t *src)
return (EADDRNOTAVAIL);
TAILQ_REMOVE(&imf->imf_sources, ims, ims_next);
- FREE(ims, M_IPMSOURCE);
+ free(ims, M_IPMSOURCE);
imf->imf_nsources--;
return (0);
@@ -734,7 +734,7 @@ inp_freemoptions(struct ip_moptions *imo)
TAILQ_FOREACH_SAFE(ims, &imf->imf_sources,
ims_next, tims) {
TAILQ_REMOVE(&imf->imf_sources, ims, ims_next);
- FREE(ims, M_IPMSOURCE);
+ free(ims, M_IPMSOURCE);
imf->imf_nsources--;
}
KASSERT(imf->imf_nsources == 0,
@@ -817,8 +817,7 @@ inp_get_source_filters(struct inpcb *inp, struct sockopt *sopt)
* has asked for, but we always tell userland how big the
* buffer really needs to be.
*/
- MALLOC(tss, struct sockaddr_storage *,
- sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs,
+ tss = malloc( sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs,
M_TEMP, M_NOWAIT);
if (tss == NULL) {
error = ENOBUFS;
@@ -836,7 +835,7 @@ inp_get_source_filters(struct inpcb *inp, struct sockopt *sopt)
if (tss != NULL) {
error = copyout(tss, msfr.msfr_srcs,
sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs);
- FREE(tss, M_TEMP);
+ free(tss, M_TEMP);
}
if (error)
@@ -1375,7 +1374,7 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sopt)
if (imo->imo_mfilters != NULL) {
TAILQ_FOREACH_SAFE(ims, &imf->imf_sources, ims_next, tims) {
TAILQ_REMOVE(&imf->imf_sources, ims, ims_next);
- FREE(ims, M_IPMSOURCE);
+ free(ims, M_IPMSOURCE);
imf->imf_nsources--;
}
KASSERT(imf->imf_nsources == 0,
@@ -1536,7 +1535,7 @@ inp_set_source_filters(struct inpcb *inp, struct sockopt *sopt)
*/
TAILQ_FOREACH_SAFE(ims, &imf->imf_sources, ims_next, tims) {
TAILQ_REMOVE(&imf->imf_sources, ims, ims_next);
- FREE(ims, M_IPMSOURCE);
+ free(ims, M_IPMSOURCE);
imf->imf_nsources--;
}
KASSERT(imf->imf_nsources == 0,
@@ -1570,13 +1569,12 @@ inp_set_source_filters(struct inpcb *inp, struct sockopt *sopt)
* that we may copy them with a single copyin. This
* allows us to deal with page faults up-front.
*/
- MALLOC(kss, struct sockaddr_storage *,
- sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs,
+ kss = malloc( sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs,
M_TEMP, M_WAITOK);
error = copyin(msfr.msfr_srcs, kss,
sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs);
if (error) {
- FREE(kss, M_TEMP);
+ free(kss, M_TEMP);
return (error);
}
@@ -1616,7 +1614,7 @@ inp_set_source_filters(struct inpcb *inp, struct sockopt *sopt)
break;
}
if (error) {
- FREE(kss, M_TEMP);
+ free(kss, M_TEMP);
return (error);
}
@@ -1625,8 +1623,7 @@ inp_set_source_filters(struct inpcb *inp, struct sockopt *sopt)
* entries we are about to allocate, in case we
* abruptly need to free them.
*/
- MALLOC(pnims, struct in_msource **,
- sizeof(struct in_msource *) * msfr.msfr_nsrcs,
+ pnims = malloc( sizeof(struct in_msource *) * msfr.msfr_nsrcs,
M_TEMP, M_WAITOK | M_ZERO);
/*
@@ -1637,18 +1634,17 @@ inp_set_source_filters(struct inpcb *inp, struct sockopt *sopt)
pkss = kss;
nims = NULL;
for (i = 0; i < msfr.msfr_nsrcs; i++, pkss++) {
- MALLOC(nims, struct in_msource *,
- sizeof(struct in_msource) * msfr.msfr_nsrcs,
+ nims = malloc( sizeof(struct in_msource) * msfr.msfr_nsrcs,
M_IPMSOURCE, M_WAITOK | M_ZERO);
pnims[i] = nims;
}
if (i < msfr.msfr_nsrcs) {
for (j = 0; j < i; j++) {
if (pnims[j] != NULL)
- FREE(pnims[j], M_IPMSOURCE);
+ free(pnims[j], M_IPMSOURCE);
}
- FREE(pnims, M_TEMP);
- FREE(kss, M_TEMP);
+ free(pnims, M_TEMP);
+ free(kss, M_TEMP);
return (ENOBUFS);
}
@@ -1667,8 +1663,8 @@ inp_set_source_filters(struct inpcb *inp, struct sockopt *sopt)
ims_next);
imf->imf_nsources++;
}
- FREE(pnims, M_TEMP);
- FREE(kss, M_TEMP);
+ free(pnims, M_TEMP);
+ free(kss, M_TEMP);
}
/*
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 45c47988ecc7..7732133d830c 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -963,7 +963,7 @@ in_sockaddr(in_port_t port, struct in_addr *addr_p)
{
struct sockaddr_in *sin;
- MALLOC(sin, struct sockaddr_in *, sizeof *sin, M_SONAME,
+ sin = malloc(sizeof *sin, M_SONAME,
M_WAITOK | M_ZERO);
sin->sin_family = AF_INET;
sin->sin_len = sizeof(*sin);
@@ -1301,7 +1301,7 @@ in_pcbinshash(struct inpcb *inp)
* If none exists, malloc one and tack it on.
*/
if (phd == NULL) {
- MALLOC(phd, struct inpcbport *, sizeof(struct inpcbport), M_PCB, M_NOWAIT);
+ phd = malloc(sizeof(struct inpcbport), M_PCB, M_NOWAIT);
if (phd == NULL) {
return (ENOBUFS); /* XXX */
}
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 25b629d90e33..f93b895a1781 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -388,10 +388,10 @@ carp_clone_create(struct if_clone *ifc, int unit, caddr_t params)
struct carp_softc *sc;
struct ifnet *ifp;
- MALLOC(sc, struct carp_softc *, sizeof(*sc), M_CARP, M_WAITOK|M_ZERO);
+ sc = malloc(sizeof(*sc), M_CARP, M_WAITOK|M_ZERO);
ifp = SC2IFP(sc) = if_alloc(IFT_ETHER);
if (ifp == NULL) {
- FREE(sc, M_CARP);
+ free(sc, M_CARP);
return (ENOSPC);
}
@@ -497,7 +497,7 @@ carpdetach(struct carp_softc *sc, int unlock)
ifpromisc(sc->sc_carpdev, 0);
sc->sc_carpdev->if_carp = NULL;
CARP_LOCK_DESTROY(cif);
- FREE(cif, M_IFADDR);
+ free(cif, M_IFADDR);
} else if (unlock)
CARP_UNLOCK(cif);
sc->sc_carpdev = NULL;
@@ -1512,14 +1512,14 @@ carp_set_addr(struct carp_softc *sc, struct sockaddr_in *sin)
if (!ifp->if_carp) {
- MALLOC(cif, struct carp_if *, sizeof(*cif), M_CARP,
+ cif = malloc(sizeof(*cif), M_CARP,
M_WAITOK|M_ZERO);
if (!cif) {
error = ENOBUFS;
goto cleanup;
}
if ((error = ifpromisc(ifp, 1))) {
- FREE(cif, M_CARP);
+ free(cif, M_CARP);
goto cleanup;
}
@@ -1606,7 +1606,7 @@ carp_del_addr(struct carp_softc *sc, struct sockaddr_in *sin)
if (!--cif->vhif_nvrs) {
sc->sc_carpdev->if_carp = NULL;
CARP_LOCK_DESTROY(cif);
- FREE(cif, M_IFADDR);
+ free(cif, M_IFADDR);
} else {
CARP_UNLOCK(cif);
}
@@ -1702,14 +1702,14 @@ carp_set_addr6(struct carp_softc *sc, struct sockaddr_in6 *sin6)
}
if (!ifp->if_carp) {
- MALLOC(cif, struct carp_if *, sizeof(*cif), M_CARP,
+ cif = malloc(sizeof(*cif), M_CARP,
M_WAITOK|M_ZERO);
if (!cif) {
error = ENOBUFS;
goto cleanup;
}
if ((error = ifpromisc(ifp, 1))) {
- FREE(cif, M_CARP);
+ free(cif, M_CARP);
goto cleanup;
}
@@ -1807,7 +1807,7 @@ carp_del_addr6(struct carp_softc *sc, struct sockaddr_in6 *sin6)
if (!--cif->vhif_nvrs) {
CARP_LOCK_DESTROY(cif);
sc->sc_carpdev->if_carp = NULL;
- FREE(cif, M_IFADDR);
+ free(cif, M_IFADDR);
} else
CARP_UNLOCK(cif);
}
diff --git a/sys/netinet/sctp_os_bsd.h b/sys/netinet/sctp_os_bsd.h
index 9514f7a218cf..8e881397ee18 100644
--- a/sys/netinet/sctp_os_bsd.h
+++ b/sys/netinet/sctp_os_bsd.h
@@ -248,17 +248,17 @@ MALLOC_DECLARE(SCTP_M_SOCKOPT);
*/
#define SCTP_MALLOC(var, type, size, name) \
do { \
- MALLOC(var, type, size, name, M_NOWAIT); \
+ var = (type)malloc(size, name, M_NOWAIT); \
} while (0)
-#define SCTP_FREE(var, type) FREE(var, type)
+#define SCTP_FREE(var, type) free(var, type)
#define SCTP_MALLOC_SONAME(var, type, size) \
do { \
- MALLOC(var, type, size, M_SONAME, M_WAITOK | M_ZERO); \
+ var = (type)malloc(size, M_SONAME, M_WAITOK | M_ZERO); \
} while (0)
-#define SCTP_FREE_SONAME(var) FREE(var, M_SONAME)
+#define SCTP_FREE_SONAME(var) free(var, M_SONAME)
#define SCTP_PROCESS_STRUCT struct proc *
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
index b3846ce787b2..d81a24e4dfba 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -247,8 +247,7 @@ syncache_init(void)
&V_tcp_syncache.cache_limit);
/* Allocate the hash table. */
- MALLOC(V_tcp_syncache.hashbase, struct syncache_head *,
- V_tcp_syncache.hashsize * sizeof(struct syncache_head),
+ V_tcp_syncache.hashbase = malloc( V_tcp_syncache.hashsize * sizeof(struct syncache_head),
M_SYNCACHE, M_WAITOK | M_ZERO);
/* Initialize the hash buckets. */
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 19fba30dff84..483409665a0c 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -2321,10 +2321,10 @@ in6_sin_2_v4mapsin6_in_sock(struct sockaddr **nam)
struct sockaddr_in *sin_p;
struct sockaddr_in6 *sin6_p;
- MALLOC(sin6_p, struct sockaddr_in6 *, sizeof *sin6_p, M_SONAME,
+ sin6_p = malloc(sizeof *sin6_p, M_SONAME,
M_WAITOK);
sin_p = (struct sockaddr_in *)*nam;
in6_sin_2_v4mapsin6(sin_p, sin6_p);
- FREE(*nam, M_SONAME);
+ free(*nam, M_SONAME);
*nam = (struct sockaddr *)sin6_p;
}
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c
index 506b515567b1..724c143020ab 100644
--- a/sys/netinet6/in6_pcb.c
+++ b/sys/netinet6/in6_pcb.c
@@ -454,7 +454,7 @@ in6_sockaddr(in_port_t port, struct in6_addr *addr_p)
{
struct sockaddr_in6 *sin6;
- MALLOC(sin6, struct sockaddr_in6 *, sizeof *sin6, M_SONAME, M_WAITOK);
+ sin6 = malloc(sizeof *sin6, M_SONAME, M_WAITOK);
bzero(sin6, sizeof *sin6);
sin6->sin6_family = AF_INET6;
sin6->sin6_len = sizeof(*sin6);
@@ -477,7 +477,7 @@ in6_v4mapsin6_sockaddr(in_port_t port, struct in_addr *addr_p)
sin.sin_port = port;
sin.sin_addr = *addr_p;
- MALLOC(sin6_p, struct sockaddr_in6 *, sizeof *sin6_p, M_SONAME,
+ sin6_p = malloc(sizeof *sin6_p, M_SONAME,
M_WAITOK);
in6_sin_2_v4mapsin6(&sin, sin6_p);
diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c
index 7daa76ff7df2..1bb673d1653e 100644
--- a/sys/netinet6/in6_src.c
+++ b/sys/netinet6/in6_src.c
@@ -988,7 +988,7 @@ add_addrsel_policyent(struct in6_addrpolicy *newpolicy)
INIT_VNET_INET6(curvnet);
struct addrsel_policyent *new, *pol;
- MALLOC(new, struct addrsel_policyent *, sizeof(*new), M_IFADDR,
+ new = malloc(sizeof(*new), M_IFADDR,
M_WAITOK);
ADDRSEL_XLOCK();
ADDRSEL_LOCK();
@@ -1001,7 +1001,7 @@ add_addrsel_policyent(struct in6_addrpolicy *newpolicy)
&pol->ape_policy.addrmask.sin6_addr)) {
ADDRSEL_UNLOCK();
ADDRSEL_XUNLOCK();
- FREE(new, M_IFADDR);
+ free(new, M_IFADDR);
return (EEXIST); /* or override it? */
}
}
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index 4fafdb124a8a..8b99b08236a9 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -565,15 +565,14 @@ rip6_attach(struct socket *so, int proto, struct thread *td)
error = soreserve(so, rip_sendspace, rip_recvspace);
if (error)
return (error);
- MALLOC(filter, struct icmp6_filter *,
- sizeof(struct icmp6_filter), M_PCB, M_NOWAIT);
+ filter = malloc( sizeof(struct icmp6_filter), M_PCB, M_NOWAIT);
if (filter == NULL)
return (ENOMEM);
INP_INFO_WLOCK(&V_ripcbinfo);
error = in_pcballoc(so, &V_ripcbinfo);
if (error) {
INP_INFO_WUNLOCK(&V_ripcbinfo);
- FREE(filter, M_PCB);
+ free(filter, M_PCB);
return (error);
}
inp = (struct inpcb *)so->so_pcb;
@@ -602,7 +601,7 @@ rip6_detach(struct socket *so)
/* xxx: RSVP */
INP_INFO_WLOCK(&V_ripcbinfo);
INP_WLOCK(inp);
- FREE(inp->in6p_icmp6filt, M_PCB);
+ free(inp->in6p_icmp6filt, M_PCB);
in6_pcbdetach(inp);
in6_pcbfree(inp);
INP_INFO_WUNLOCK(&V_ripcbinfo);
diff --git a/sys/netipsec/keysock.c b/sys/netipsec/keysock.c
index 2f7426100bee..882aed4112b2 100644
--- a/sys/netipsec/keysock.c
+++ b/sys/netipsec/keysock.c
@@ -404,7 +404,7 @@ key_attach(struct socket *so, int proto, struct thread *td)
}
/* XXX */
- MALLOC(kp, struct keycb *, sizeof *kp, M_PCB, M_WAITOK | M_ZERO);
+ kp = malloc(sizeof *kp, M_PCB, M_WAITOK | M_ZERO);
if (kp == 0)
return ENOBUFS;
diff --git a/sys/netipsec/xform_ah.c b/sys/netipsec/xform_ah.c
index 76fecb1367f1..c5b369736310 100644
--- a/sys/netipsec/xform_ah.c
+++ b/sys/netipsec/xform_ah.c
@@ -485,7 +485,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int skip, int alg, int out)
/* Free, if we allocated. */
if (alloc)
- FREE(ptr, M_XDATA);
+ free(ptr, M_XDATA);
return EINVAL;
}
@@ -505,7 +505,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int skip, int alg, int out)
/* Free, if we allocated. */
if (alloc)
- FREE(ptr, M_XDATA);
+ free(ptr, M_XDATA);
return EINVAL;
}
}
@@ -529,7 +529,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int skip, int alg, int out)
DPRINTF(("%s: unexpected IPv6 header type %d",
__func__, off));
if (alloc)
- FREE(ptr, M_XDATA);
+ free(ptr, M_XDATA);
m_freem(m);
return EINVAL;
}
diff --git a/sys/netipx/ipx_pcb.c b/sys/netipx/ipx_pcb.c
index 36c1354e0996..a478c0815a9d 100644
--- a/sys/netipx/ipx_pcb.c
+++ b/sys/netipx/ipx_pcb.c
@@ -91,7 +91,7 @@ ipx_pcballoc(struct socket *so, struct ipxpcbhead *head, struct thread *td)
KASSERT(so->so_pcb == NULL, ("ipx_pcballoc: so_pcb != NULL"));
IPX_LIST_LOCK_ASSERT();
- MALLOC(ipxp, struct ipxpcb *, sizeof *ipxp, M_PCB, M_NOWAIT | M_ZERO);
+ ipxp = malloc(sizeof *ipxp, M_PCB, M_NOWAIT | M_ZERO);
if (ipxp == NULL)
return (ENOBUFS);
IPX_LOCK_INIT(ipxp);
@@ -317,7 +317,7 @@ ipx_pcbfree(struct ipxpcb *ipxp)
RTFREE(ipxp->ipxp_route.ro_rt);
LIST_REMOVE(ipxp, ipxp_list);
IPX_LOCK_DESTROY(ipxp);
- FREE(ipxp, M_PCB);
+ free(ipxp, M_PCB);
}
void
diff --git a/sys/netipx/spx_usrreq.c b/sys/netipx/spx_usrreq.c
index b826ee80ab67..86882cb9f07a 100644
--- a/sys/netipx/spx_usrreq.c
+++ b/sys/netipx/spx_usrreq.c
@@ -1397,12 +1397,12 @@ spx_attach(struct socket *so, int proto, struct thread *td)
return (error);
}
- MALLOC(cb, struct spxpcb *, sizeof *cb, M_PCB, M_NOWAIT | M_ZERO);
+ cb = malloc(sizeof *cb, M_PCB, M_NOWAIT | M_ZERO);
if (cb == NULL)
return (ENOBUFS);
mm = m_getclr(M_DONTWAIT, MT_DATA);
if (mm == NULL) {
- FREE(cb, M_PCB);
+ free(cb, M_PCB);
return (ENOBUFS);
}
@@ -1411,7 +1411,7 @@ spx_attach(struct socket *so, int proto, struct thread *td)
if (error) {
IPX_LIST_UNLOCK();
m_free(mm);
- FREE(cb, M_PCB);
+ free(cb, M_PCB);
return (error);
}
ipxp = sotoipxpcb(so);
@@ -1463,7 +1463,7 @@ spx_pcbdetach(struct ipxpcb *ipxp)
m_freem(m);
}
m_free(dtom(cb->s_ipx));
- FREE(cb, M_PCB);
+ free(cb, M_PCB);
ipxp->ipxp_pcb = NULL;
}
diff --git a/sys/netnatm/natm.c b/sys/netnatm/natm.c
index fd9fc01374e9..b9705db3b1a6 100644
--- a/sys/netnatm/natm.c
+++ b/sys/netnatm/natm.c
@@ -422,7 +422,7 @@ natmintr(struct mbuf *m)
if (npcb->npcb_flags & NPCB_DRAIN) {
if (npcb->npcb_inq == 0)
- FREE(npcb, M_PCB); /* done! */
+ free(npcb, M_PCB); /* done! */
NATM_UNLOCK();
m_freem(m);
return;
diff --git a/sys/netnatm/natm_pcb.c b/sys/netnatm/natm_pcb.c
index 9cbc46081254..16ceab12a43a 100644
--- a/sys/netnatm/natm_pcb.c
+++ b/sys/netnatm/natm_pcb.c
@@ -91,7 +91,7 @@ npcb_free(struct natmpcb *npcb, int op)
if (npcb->npcb_inq) {
npcb->npcb_flags = NPCB_DRAIN; /* flag for distruct. */
} else {
- FREE(npcb, M_PCB); /* kill it! */
+ free(npcb, M_PCB); /* kill it! */
}
}
}
diff --git a/sys/netncp/ncp_conn.c b/sys/netncp/ncp_conn.c
index 7848d4864172..5b61dfef879c 100644
--- a/sys/netncp/ncp_conn.c
+++ b/sys/netncp/ncp_conn.c
@@ -238,7 +238,7 @@ ncp_conn_alloc(struct ncp_conn_args *cap, struct thread *td, struct ucred *cred,
owner->cr_uid = cap->owner;
} else
owner = crhold(cred);
- MALLOC(ncp, struct ncp_conn *, sizeof(struct ncp_conn),
+ ncp = malloc(sizeof(struct ncp_conn),
M_NCPDATA, M_WAITOK | M_ZERO);
error = 0;
lockinit(&ncp->nc_lock, PZERO, "ncplck", 0, 0);
@@ -317,7 +317,7 @@ ncp_conn_free(struct ncp_conn *ncp)
if (ncp->li.password)
free(ncp->li.password, M_NCPDATA);
crfree(ncp->nc_owner);
- FREE(ncp, M_NCPDATA);
+ free(ncp, M_NCPDATA);
return (0);
}
@@ -536,7 +536,7 @@ ncp_conn_gethandle(struct ncp_conn *conn, struct thread *td, struct ncp_handle *
lockmgr(&lhlock, LK_RELEASE, 0);
return 0;
}
- MALLOC(refp,struct ncp_handle *,sizeof(struct ncp_handle),M_NCPDATA,
+ refp = malloc(sizeof(struct ncp_handle),M_NCPDATA,
M_WAITOK | M_ZERO);
SLIST_INSERT_HEAD(&lhlist,refp,nh_next);
refp->nh_ref++;
@@ -565,7 +565,7 @@ ncp_conn_puthandle(struct ncp_handle *handle, struct thread *td, int force)
}
if (refp->nh_ref == 0) {
SLIST_REMOVE(&lhlist, refp, ncp_handle, nh_next);
- FREE(refp, M_NCPDATA);
+ free(refp, M_NCPDATA);
}
lockmgr(&lhlock, LK_RELEASE, 0);
return 0;
@@ -603,7 +603,7 @@ ncp_conn_putprochandles(struct thread *td)
haveone = 1;
hp->nh_conn->ref_cnt -= hp->nh_ref;
SLIST_REMOVE(&lhlist, hp, ncp_handle, nh_next);
- FREE(hp, M_NCPDATA);
+ free(hp, M_NCPDATA);
}
lockmgr(&lhlock, LK_RELEASE, 0);
return haveone;
diff --git a/sys/netncp/ncp_rq.c b/sys/netncp/ncp_rq.c
index 38e3e54428e0..f8f7ce2ec3eb 100644
--- a/sys/netncp/ncp_rq.c
+++ b/sys/netncp/ncp_rq.c
@@ -67,7 +67,7 @@ ncp_rq_alloc_any(u_int32_t ptype, u_int8_t fn, struct ncp_conn *ncp,
struct ncp_rq *rqp;
int error;
- MALLOC(rqp, struct ncp_rq *, sizeof(*rqp), M_NCPRQ, M_WAITOK);
+ rqp = malloc(sizeof(*rqp), M_NCPRQ, M_WAITOK);
error = ncp_rq_init_any(rqp, ptype, fn, ncp, td, cred);
rqp->nr_flags |= NCPR_ALLOCED;
if (error) {
diff --git a/sys/netncp/ncp_sock.c b/sys/netncp/ncp_sock.c
index 3c4d5b9708a6..0095f3f094e8 100644
--- a/sys/netncp/ncp_sock.c
+++ b/sys/netncp/ncp_sock.c
@@ -124,7 +124,7 @@ ncp_getsockname(struct socket *so, caddr_t asa, int *alen) {
*alen=len;
}
if (sa)
- FREE(sa, M_SONAME);
+ free(sa, M_SONAME);
return (error);
}
#endif
@@ -369,7 +369,7 @@ ncp_watchdog(struct ncp_conn *conn) {
NCPSDEBUG("send watch dog %d\n",error);
break;
}
- if (sa) FREE(sa, M_SONAME);
+ if (sa) free(sa, M_SONAME);
return;
}
diff --git a/sys/netncp/ncp_subr.c b/sys/netncp/ncp_subr.c
index fd7969a9f69f..da0a6d964792 100644
--- a/sys/netncp/ncp_subr.c
+++ b/sys/netncp/ncp_subr.c
@@ -73,7 +73,7 @@ ncp_str_dup(char *s) {
len++;
if (bt == 0) break;
}
- MALLOC(p, char*, len, M_NCPDATA, M_WAITOK);
+ p = malloc(len, M_NCPDATA, M_WAITOK);
copyin(s, p, len);
return p;
}
diff --git a/sys/netsmb/smb_rq.c b/sys/netsmb/smb_rq.c
index 5d2557ce09b7..3d068b6c1574 100644
--- a/sys/netsmb/smb_rq.c
+++ b/sys/netsmb/smb_rq.c
@@ -70,7 +70,7 @@ smb_rq_alloc(struct smb_connobj *layer, u_char cmd, struct smb_cred *scred,
struct smb_rq *rqp;
int error;
- MALLOC(rqp, struct smb_rq *, sizeof(*rqp), M_SMBRQ, M_WAITOK);
+ rqp = malloc(sizeof(*rqp), M_SMBRQ, M_WAITOK);
if (rqp == NULL)
return ENOMEM;
error = smb_rq_init(rqp, layer, cmd, scred);
@@ -383,7 +383,7 @@ smb_t2_alloc(struct smb_connobj *layer, u_short setup, struct smb_cred *scred,
struct smb_t2rq *t2p;
int error;
- MALLOC(t2p, struct smb_t2rq *, sizeof(*t2p), M_SMBRQ, M_WAITOK);
+ t2p = malloc(sizeof(*t2p), M_SMBRQ, M_WAITOK);
if (t2p == NULL)
return ENOMEM;
error = smb_t2_init(t2p, layer, setup, scred);
diff --git a/sys/netsmb/smb_trantcp.c b/sys/netsmb/smb_trantcp.c
index 88fd55635eea..167b74be0191 100644
--- a/sys/netsmb/smb_trantcp.c
+++ b/sys/netsmb/smb_trantcp.c
@@ -438,7 +438,7 @@ smb_nbst_create(struct smb_vc *vcp, struct thread *td)
{
struct nbpcb *nbp;
- MALLOC(nbp, struct nbpcb *, sizeof *nbp, M_NBDATA, M_WAITOK);
+ nbp = malloc(sizeof *nbp, M_NBDATA, M_WAITOK);
bzero(nbp, sizeof *nbp);
nbp->nbp_timo.tv_sec = 15; /* XXX: sysctl ? */
nbp->nbp_state = NBST_CLOSED;
diff --git a/sys/nfs4client/nfs4_dev.c b/sys/nfs4client/nfs4_dev.c
index 35276d350f12..d8186e6d04f9 100644
--- a/sys/nfs4client/nfs4_dev.c
+++ b/sys/nfs4client/nfs4_dev.c
@@ -69,9 +69,9 @@ struct nfs4dev_upcall {
};
-#define nfs4dev_upcall_get(MP) MALLOC((MP), struct nfs4dev_upcall *, sizeof(struct nfs4dev_upcall), M_NFS4DEV, M_WAITOK | M_ZERO)
+#define nfs4dev_upcall_get(MP) (MP) = malloc(sizeof(struct nfs4dev_upcall), M_NFS4DEV, M_WAITOK | M_ZERO)
-#define nfs4dev_upcall_put(MP) FREE((MP), M_NFS4DEV)
+#define nfs4dev_upcall_put(MP) free((MP), M_NFS4DEV)
static int nfs4dev_nopen = 0;
static struct thread * nfs4dev_reader = NULL;
diff --git a/sys/nfs4client/nfs4_idmap.c b/sys/nfs4client/nfs4_idmap.c
index 000ad17044a6..5a02b47cebc9 100644
--- a/sys/nfs4client/nfs4_idmap.c
+++ b/sys/nfs4client/nfs4_idmap.c
@@ -56,8 +56,8 @@
MALLOC_DEFINE(M_IDMAP, "idmap", "idmap");
-#define idmap_entry_get(ID) MALLOC((ID), struct idmap_entry, sizeof(struct idmap_entry), M_IDMAP, M_WAITOK | M_ZERO)
-#define idmap_entry_put(ID) FREE((ID), M_IDMAP)
+#define idmap_entry_get(ID) (ID) = malloc(sizeof(struct idmap_entry), M_IDMAP, M_WAITOK | M_ZERO)
+#define idmap_entry_put(ID) free((ID), M_IDMAP)
@@ -106,7 +106,7 @@ idmap_upcall_name(uint32_t type, char * name, struct idmap_entry ** found)
return EFAULT; /* XXX */
}
- MALLOC(e, struct idmap_entry *, sizeof(struct idmap_entry), M_IDMAP,
+ e = malloc(sizeof(struct idmap_entry), M_IDMAP,
M_WAITOK | M_ZERO);
e->id_info.id_type = type;
@@ -144,7 +144,7 @@ idmap_upcall_id(uint32_t type, ident_t id, struct idmap_entry ** found)
if (type > IDMAP_MAX_TYPE)
panic("bad type"); /* XXX */
- MALLOC(e, struct idmap_entry *, sizeof(struct idmap_entry), M_IDMAP,
+ e = malloc(sizeof(struct idmap_entry), M_IDMAP,
M_WAITOK | M_ZERO);
e->id_info.id_type = type;
@@ -340,14 +340,14 @@ void idmap_uninit(void)
e = TAILQ_FIRST(&idmap_uid_hash.hash_name[i]);
TAILQ_REMOVE(&idmap_uid_hash.hash_name[i], e, id_entry_name);
TAILQ_REMOVE(&idmap_uid_hash.hash_id[i], e, id_entry_id);
- FREE(e, M_IDMAP);
+ free(e, M_IDMAP);
}
while(!TAILQ_EMPTY(&idmap_gid_hash.hash_name[i])) {
e = TAILQ_FIRST(&idmap_gid_hash.hash_name[i]);
TAILQ_REMOVE(&idmap_gid_hash.hash_name[i], e, id_entry_name);
TAILQ_REMOVE(&idmap_gid_hash.hash_id[i], e, id_entry_id);
- FREE(e, M_IDMAP);
+ free(e, M_IDMAP);
}
}
@@ -376,7 +376,7 @@ idmap_uid_to_name(uid_t uid, char ** name, size_t * len)
if (idmap_add(e) != 0) {
IDMAP_DEBUG("idmap_add failed\n");
- FREE(e, M_IDMAP);
+ free(e, M_IDMAP);
return EFAULT;
}
}
@@ -409,7 +409,7 @@ idmap_gid_to_name(gid_t gid, char ** name, size_t * len)
if (idmap_add(e) != 0) {
IDMAP_DEBUG("idmap_add failed\n");
- FREE(e, M_IDMAP);
+ free(e, M_IDMAP);
}
}
@@ -434,31 +434,31 @@ idmap_name_to_uid(char * name, size_t len, uid_t * id)
}
/* XXX hack */
- MALLOC(namestr, char *, len + 1, M_TEMP, M_WAITOK);
+ namestr = malloc(len + 1, M_TEMP, M_WAITOK);
bcopy(name, namestr, len);
namestr[len] = '\0';
if ((e = idmap_name_lookup(IDMAP_TYPE_UID, namestr)) == NULL) {
if ((error = idmap_upcall_name(IDMAP_TYPE_UID, namestr, &e))) {
- FREE(namestr, M_TEMP);
+ free(namestr, M_TEMP);
return error;
}
if (e == NULL) {
IDMAP_DEBUG("no error from upcall, but no data returned\n");
- FREE(namestr, M_TEMP);
+ free(namestr, M_TEMP);
return EFAULT;
}
if (idmap_add(e) != 0) {
IDMAP_DEBUG("idmap_add failed\n");
- FREE(e, M_IDMAP);
+ free(e, M_IDMAP);
}
}
*id = e->id_info.id_id.uid;
- FREE(namestr, M_TEMP);
+ free(namestr, M_TEMP);
return 0;
}
@@ -479,7 +479,7 @@ idmap_name_to_gid(char * name, size_t len, gid_t * id)
}
/* XXX hack */
- MALLOC(namestr, char *, len + 1, M_TEMP, M_WAITOK);
+ namestr = malloc(len + 1, M_TEMP, M_WAITOK);
bcopy(name, namestr, len);
namestr[len] = '\0';
@@ -487,23 +487,23 @@ idmap_name_to_gid(char * name, size_t len, gid_t * id)
if ((e = idmap_name_lookup(IDMAP_TYPE_GID, namestr)) == NULL) {
if ((error = idmap_upcall_name(IDMAP_TYPE_GID, namestr, &e)) != 0) {
IDMAP_DEBUG("error in upcall\n");
- FREE(namestr, M_TEMP);
+ free(namestr, M_TEMP);
return error;
}
if (e == NULL) {
IDMAP_DEBUG("no error from upcall, but no data returned\n");
- FREE(namestr, M_TEMP);
+ free(namestr, M_TEMP);
return EFAULT;
}
if (idmap_add(e) != 0) {
IDMAP_DEBUG("idmap_add failed\n");
- FREE(e, M_IDMAP);
+ free(e, M_IDMAP);
}
}
*id = e->id_info.id_id.gid;
- FREE(namestr, M_TEMP);
+ free(namestr, M_TEMP);
return 0;
}
diff --git a/sys/nfs4client/nfs4_socket.c b/sys/nfs4client/nfs4_socket.c
index e5b2ab852954..754ba479176e 100644
--- a/sys/nfs4client/nfs4_socket.c
+++ b/sys/nfs4client/nfs4_socket.c
@@ -180,7 +180,7 @@ nfs4_connect(struct nfsmount *nmp)
struct thread * td = curthread;
#endif
- MALLOC(auth, struct rpc_auth *, sizeof(struct rpc_auth), M_TEMP, M_WAITOK);
+ auth = malloc(sizeof(struct rpc_auth), M_TEMP, M_WAITOK);
auth->auth_type = RPCAUTH_UNIX;
/* translate nfs flags -> rpcclnt flags */
diff --git a/sys/nfs4client/nfs4_vfsops.c b/sys/nfs4client/nfs4_vfsops.c
index d7d853c7201a..8980cef42709 100644
--- a/sys/nfs4client/nfs4_vfsops.c
+++ b/sys/nfs4client/nfs4_vfsops.c
@@ -555,7 +555,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam,
if (mp->mnt_flag & MNT_UPDATE) {
nmp = VFSTONFS(mp);
/* update paths, file handles, etc, here XXX */
- FREE(nam, M_SONAME);
+ free(nam, M_SONAME);
return (0);
} else {
nmp = uma_zalloc(nfsmount_zone, M_WAITOK);
@@ -660,7 +660,7 @@ bad:
mtx_destroy(&nmp->nm_mtx);
nfs4_disconnect(nmp);
uma_zfree(nfsmount_zone, nmp);
- FREE(nam, M_SONAME);
+ free(nam, M_SONAME);
return (error);
}
@@ -699,7 +699,7 @@ nfs4_unmount(struct mount *mp, int mntflags, struct thread *td)
* We are now committed to the unmount.
*/
nfs4_disconnect(nmp);
- FREE(nmp->nm_nam, M_SONAME);
+ free(nmp->nm_nam, M_SONAME);
/* XXX there's a race condition here for SMP */
wakeup(&nfs4_daemonproc);
diff --git a/sys/nfs4client/nfs4_vn_subs.c b/sys/nfs4client/nfs4_vn_subs.c
index 317c7ffe28da..12095d015d8e 100644
--- a/sys/nfs4client/nfs4_vn_subs.c
+++ b/sys/nfs4client/nfs4_vn_subs.c
@@ -176,7 +176,7 @@ nfs4_getcookie(struct nfsnode *np, off_t off, int add)
dp = LIST_FIRST(&np->n_cookies);
if (!dp) {
if (add) {
- MALLOC(dp, struct nfsdmap *, sizeof (struct nfsdmap),
+ dp = malloc(sizeof (struct nfsdmap),
M_NFSDIROFF, M_WAITOK);
dp->ndm_eocookie = 0;
LIST_INSERT_HEAD(&np->n_cookies, dp, ndm_list);
@@ -191,7 +191,7 @@ nfs4_getcookie(struct nfsnode *np, off_t off, int add)
return (NULL);
dp = LIST_NEXT(dp, ndm_list);
} else if (add) {
- MALLOC(dp2, struct nfsdmap *, sizeof (struct nfsdmap),
+ dp2 = malloc(sizeof (struct nfsdmap),
M_NFSDIROFF, M_WAITOK);
dp2->ndm_eocookie = 0;
LIST_INSERT_AFTER(dp, dp2, ndm_list);
diff --git a/sys/nfs4client/nfs4_vnops.c b/sys/nfs4client/nfs4_vnops.c
index 0f540777de58..db2b30a85cbf 100644
--- a/sys/nfs4client/nfs4_vnops.c
+++ b/sys/nfs4client/nfs4_vnops.c
@@ -506,8 +506,8 @@ nfs4_openrpc(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
np->n_dvp = dvp;
np->n_namelen = cnp->cn_namelen; /* XXX memory leaks on these; track! */
if (np->n_name != NULL)
- FREE(np->n_name, M_NFSREQ);
- MALLOC(np->n_name, u_char *, np->n_namelen + 1, M_NFSREQ, M_WAITOK);
+ free(np->n_name, M_NFSREQ);
+ np->n_name = malloc(np->n_namelen + 1, M_NFSREQ, M_WAITOK);
bcopy(cnp->cn_nameptr, np->n_name, np->n_namelen);
np->n_name[np->n_namelen] = '\0';
if (flags & FWRITE)
@@ -1071,8 +1071,8 @@ nfs4_lookup(struct vop_lookup_args *ap)
np->n_dvp = dvp;
np->n_namelen = cnp->cn_namelen;
if (np->n_name != NULL)
- FREE(np->n_name, M_NFSREQ);
- MALLOC(np->n_name, u_char *, np->n_namelen + 1, M_NFSREQ, M_WAITOK);
+ free(np->n_name, M_NFSREQ);
+ np->n_name = malloc(np->n_namelen + 1, M_NFSREQ, M_WAITOK);
bcopy(cnp->cn_nameptr, np->n_name, np->n_namelen);
np->n_name[np->n_namelen] = '\0';
@@ -1455,7 +1455,7 @@ nfs4_createrpc(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
m_freem(mrep);
/* XXX */
- /*FREE(cnp->cn_pnbuf, M_NAMEI);*/
+ /*free(cnp->cn_pnbuf, M_NAMEI);*/
if (error != 0 && newvp != NULL)
vput(newvp);
else if (error == 0)
@@ -2235,7 +2235,7 @@ nfs4_sillyrename(struct vnode *dvp, struct vnode *vp, struct componentname *cnp)
if (vp->v_type == VDIR)
panic("nfs: sillyrename dir");
#endif
- MALLOC(sp, struct sillyrename *, sizeof (struct sillyrename),
+ sp = malloc(sizeof (struct sillyrename),
M_NFSREQ, M_WAITOK);
sp->s_cred = crhold(cnp->cn_cred);
sp->s_dvp = dvp;
@@ -2351,9 +2351,8 @@ nfs4_lookitup(struct vnode *dvp, const char *name, int len, struct ucred *cred,
np->n_dvp = dvp;
np->n_namelen = len;
if (np->n_name != NULL)
- FREE(np->n_name, M_NFSREQ);
- MALLOC(np->n_name, u_char *,
- np->n_namelen + 1, M_NFSREQ, M_WAITOK);
+ free(np->n_name, M_NFSREQ);
+ np->n_name = malloc( np->n_namelen + 1, M_NFSREQ, M_WAITOK);
memcpy(np->n_name, name, len);
np->n_name[len] = '\0';
}
diff --git a/sys/nfsclient/krpc_subr.c b/sys/nfsclient/krpc_subr.c
index d7f60597fe2a..5682083cecee 100644
--- a/sys/nfsclient/krpc_subr.c
+++ b/sys/nfsclient/krpc_subr.c
@@ -334,7 +334,7 @@ krpc_call(struct sockaddr_in *sa, u_int prog, u_int vers, u_int func,
secs = timo;
while (secs > 0) {
if (from) {
- FREE(from, M_SONAME);
+ free(from, M_SONAME);
from = NULL;
}
if (m) {
diff --git a/sys/nfsclient/nfs_lock.c b/sys/nfsclient/nfs_lock.c
index bf5270644c1d..45614b5c2657 100644
--- a/sys/nfsclient/nfs_lock.c
+++ b/sys/nfsclient/nfs_lock.c
@@ -281,8 +281,7 @@ nfs_dolock(struct vop_advlock_args *ap)
* if there is no nfsowner table yet, allocate one.
*/
if (p->p_nlminfo == NULL) {
- MALLOC(p->p_nlminfo, struct nlminfo *,
- sizeof(struct nlminfo), M_NLMINFO, M_WAITOK | M_ZERO);
+ p->p_nlminfo = malloc( sizeof(struct nlminfo), M_NLMINFO, M_WAITOK | M_ZERO);
p->p_nlminfo->pid_start = p->p_stats->p_start;
timevaladd(&p->p_nlminfo->pid_start, &boottime);
}
diff --git a/sys/nfsclient/nfs_node.c b/sys/nfsclient/nfs_node.c
index 03e672a8454b..517c3a9cc694 100644
--- a/sys/nfsclient/nfs_node.c
+++ b/sys/nfsclient/nfs_node.c
@@ -161,7 +161,7 @@ nfs_nget(struct mount *mntp, nfsfh_t *fhp, int fhsize, struct nfsnode **npp, int
VN_LOCK_AREC(vp);
VN_LOCK_ASHARE(vp);
if (fhsize > NFS_SMALLFH) {
- MALLOC(np->n_fhp, nfsfh_t *, fhsize, M_NFSBIGFH, M_WAITOK);
+ np->n_fhp = malloc(fhsize, M_NFSBIGFH, M_WAITOK);
} else
np->n_fhp = &np->n_fh;
bcopy((caddr_t)fhp, (caddr_t)np->n_fhp, fhsize);
@@ -171,7 +171,7 @@ nfs_nget(struct mount *mntp, nfsfh_t *fhp, int fhsize, struct nfsnode **npp, int
if (error != 0) {
*npp = NULL;
if (np->n_fhsize > NFS_SMALLFH) {
- FREE((caddr_t)np->n_fhp, M_NFSBIGFH);
+ free((caddr_t)np->n_fhp, M_NFSBIGFH);
}
mtx_destroy(&np->n_mtx);
uma_zfree(nfsnode_zone, np);
@@ -214,7 +214,7 @@ nfs_inactive(struct vop_inactive_args *ap)
(sp->s_removeit)(sp);
crfree(sp->s_cred);
vrele(sp->s_dvp);
- FREE((caddr_t)sp, M_NFSREQ);
+ free((caddr_t)sp, M_NFSREQ);
}
np->n_flag &= NMODIFIED;
return (0);
@@ -257,11 +257,11 @@ nfs_reclaim(struct vop_reclaim_args *ap)
while (dp) {
dp2 = dp;
dp = LIST_NEXT(dp, ndm_list);
- FREE((caddr_t)dp2, M_NFSDIROFF);
+ free((caddr_t)dp2, M_NFSDIROFF);
}
}
if (np->n_fhsize > NFS_SMALLFH) {
- FREE((caddr_t)np->n_fhp, M_NFSBIGFH);
+ free((caddr_t)np->n_fhp, M_NFSBIGFH);
}
mtx_destroy(&np->n_mtx);
uma_zfree(nfsnode_zone, vp->v_data);
diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c
index 34203f68e892..a2a0b14eda1b 100644
--- a/sys/nfsclient/nfs_socket.c
+++ b/sys/nfsclient/nfs_socket.c
@@ -1141,7 +1141,7 @@ nfs_request(struct vnode *vp, struct mbuf *mrest, int procnum,
nmp = VFSTONFS(vp->v_mount);
if ((nmp->nm_flag & NFSMNT_NFSV4) != 0)
return nfs4_request(vp, mrest, procnum, td, cred, mrp, mdp, dposp);
- MALLOC(rep, struct nfsreq *, sizeof(struct nfsreq), M_NFSREQ, M_WAITOK);
+ rep = malloc(sizeof(struct nfsreq), M_NFSREQ, M_WAITOK);
bzero(rep, sizeof(struct nfsreq));
rep->r_nmp = nmp;
rep->r_vp = vp;
@@ -1382,7 +1382,7 @@ wait_for_pinned_req:
*dposp = dpos;
m_freem(rep->r_mreq);
mtx_destroy(&rep->r_mtx);
- FREE((caddr_t)rep, M_NFSREQ);
+ free((caddr_t)rep, M_NFSREQ);
return (0);
}
m_freem(mrep);
diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c
index 9f57ab32bf31..03be81938608 100644
--- a/sys/nfsclient/nfs_subs.c
+++ b/sys/nfsclient/nfs_subs.c
@@ -843,7 +843,7 @@ nfs_getcookie(struct nfsnode *np, off_t off, int add)
dp = LIST_FIRST(&np->n_cookies);
if (!dp) {
if (add) {
- MALLOC(dp, struct nfsdmap *, sizeof (struct nfsdmap),
+ dp = malloc(sizeof (struct nfsdmap),
M_NFSDIROFF, M_WAITOK);
dp->ndm_eocookie = 0;
LIST_INSERT_HEAD(&np->n_cookies, dp, ndm_list);
@@ -858,7 +858,7 @@ nfs_getcookie(struct nfsnode *np, off_t off, int add)
goto out;
dp = LIST_NEXT(dp, ndm_list);
} else if (add) {
- MALLOC(dp2, struct nfsdmap *, sizeof (struct nfsdmap),
+ dp2 = malloc(sizeof (struct nfsdmap),
M_NFSDIROFF, M_WAITOK);
dp2->ndm_eocookie = 0;
LIST_INSERT_AFTER(dp, dp2, ndm_list);
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index a175f333a232..1aa6d8c3afed 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -987,7 +987,7 @@ nfs_mount(struct mount *mp, struct thread *td)
error = ENAMETOOLONG;
goto out;
}
- MALLOC(nam, struct sockaddr *, args.addrlen, M_SONAME,
+ nam = malloc(args.addrlen, M_SONAME,
M_WAITOK);
bcopy(args.addr, nam, args.addrlen);
nam->sa_len = args.addrlen;
@@ -1119,7 +1119,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam,
if (mp->mnt_flag & MNT_UPDATE) {
nmp = VFSTONFS(mp);
printf("%s: MNT_UPDATE is no longer handled here\n", __func__);
- FREE(nam, M_SONAME);
+ free(nam, M_SONAME);
return (0);
} else {
nmp = uma_zalloc(nfsmount_zone, M_WAITOK);
@@ -1226,7 +1226,7 @@ bad:
nfs_disconnect(nmp);
mtx_destroy(&nmp->nm_mtx);
uma_zfree(nfsmount_zone, nmp);
- FREE(nam, M_SONAME);
+ free(nam, M_SONAME);
return (error);
}
@@ -1263,7 +1263,7 @@ nfs_unmount(struct mount *mp, int mntflags, struct thread *td)
* We are now committed to the unmount.
*/
nfs_disconnect(nmp);
- FREE(nmp->nm_nam, M_SONAME);
+ free(nmp->nm_nam, M_SONAME);
mtx_destroy(&nmp->nm_mtx);
uma_zfree(nfsmount_zone, nmp);
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c
index 33b391c47fc3..a9f9c3fc8df3 100644
--- a/sys/nfsclient/nfs_vnops.c
+++ b/sys/nfsclient/nfs_vnops.c
@@ -2543,7 +2543,7 @@ nfs_sillyrename(struct vnode *dvp, struct vnode *vp, struct componentname *cnp)
if (vp->v_type == VDIR)
panic("nfs: sillyrename dir");
#endif
- MALLOC(sp, struct sillyrename *, sizeof (struct sillyrename),
+ sp = malloc(sizeof (struct sillyrename),
M_NFSREQ, M_WAITOK);
sp->s_cred = crhold(cnp->cn_cred);
sp->s_dvp = dvp;
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
index a117cb8911eb..a339e5587b7f 100644
--- a/sys/nfsserver/nfs_serv.c
+++ b/sys/nfsserver/nfs_serv.c
@@ -940,7 +940,7 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
m2 = m;
}
}
- MALLOC(iv, struct iovec *, i * sizeof (struct iovec),
+ iv = malloc(i * sizeof (struct iovec),
M_TEMP, M_WAITOK);
uiop->uio_iov = iv2 = iv;
m = mb;
@@ -968,7 +968,7 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
error = VOP_READ(vp, uiop, IO_NODELOCKED | ioflag, cred);
off = uiop->uio_offset;
nh->nh_nextr = off;
- FREE((caddr_t)iv2, M_TEMP);
+ free((caddr_t)iv2, M_TEMP);
if (error || (getret = VOP_GETATTR(vp, vap, cred))) {
if (!error)
error = getret;
@@ -1141,7 +1141,7 @@ nfsrv_write(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
}
if (len > 0) {
- MALLOC(ivp, struct iovec *, cnt * sizeof (struct iovec), M_TEMP,
+ ivp = malloc(cnt * sizeof (struct iovec), M_TEMP,
M_WAITOK);
uiop->uio_iov = iv = ivp;
uiop->uio_iovcnt = cnt;
@@ -1176,7 +1176,7 @@ nfsrv_write(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
error = VOP_WRITE(vp, uiop, ioflags, cred);
/* Unlocked write. */
nfsrvstats.srvvop_writes++;
- FREE((caddr_t)iv, M_TEMP);
+ free((caddr_t)iv, M_TEMP);
}
aftat_ret = VOP_GETATTR(vp, vap, cred);
vput(vp);
@@ -1465,7 +1465,7 @@ loop1:
mp = mp->m_next;
}
uiop->uio_iovcnt = i;
- MALLOC(iov, struct iovec *, i * sizeof (struct iovec),
+ iov = malloc(i * sizeof (struct iovec),
M_TEMP, M_WAITOK);
uiop->uio_iov = ivp = iov;
mp = mrep;
@@ -1493,7 +1493,7 @@ loop1:
vn_finished_write(mntp);
}
VFS_UNLOCK_GIANT(mvfslocked);
- FREE((caddr_t)iov, M_TEMP);
+ free((caddr_t)iov, M_TEMP);
}
m_freem(mrep);
if (vp) {
@@ -2676,7 +2676,7 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
}
if (error)
goto out;
- MALLOC(pathcp, caddr_t, len2 + 1, M_TEMP, M_WAITOK);
+ pathcp = malloc(len2 + 1, M_TEMP, M_WAITOK);
iv.iov_base = pathcp;
iv.iov_len = len2;
io.uio_resid = len2;
@@ -2754,7 +2754,7 @@ out:
* make any sense? XXX can nfsm_reply() block?
*/
if (pathcp) {
- FREE(pathcp, M_TEMP);
+ free(pathcp, M_TEMP);
pathcp = NULL;
}
if (dirp) {
@@ -2792,7 +2792,7 @@ nfsmout:
if (dirp)
vrele(dirp);
if (pathcp)
- FREE(pathcp, M_TEMP);
+ free(pathcp, M_TEMP);
vn_finished_write(mp);
VFS_UNLOCK_GIANT(vfslocked);
@@ -3221,7 +3221,7 @@ nfsrv_readdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
/*
* end section. Allocate rbuf and continue
*/
- MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK);
+ rbuf = malloc(siz, M_TEMP, M_WAITOK);
again:
iv.iov_base = rbuf;
iv.iov_len = fullsiz;
@@ -3281,8 +3281,8 @@ again:
tl = nfsm_build(u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = nfsrv_nfs_false;
*tl = nfsrv_nfs_true;
- FREE((caddr_t)rbuf, M_TEMP);
- FREE((caddr_t)cookies, M_TEMP);
+ free((caddr_t)rbuf, M_TEMP);
+ free((caddr_t)cookies, M_TEMP);
error = 0;
goto nfsmout;
}
@@ -3409,8 +3409,8 @@ again:
mp->m_len = bp - mtod(mp, caddr_t);
} else
mp->m_len += bp - bpos;
- FREE((caddr_t)rbuf, M_TEMP);
- FREE((caddr_t)cookies, M_TEMP);
+ free((caddr_t)rbuf, M_TEMP);
+ free((caddr_t)cookies, M_TEMP);
nfsmout:
if (vp)
@@ -3503,7 +3503,7 @@ nfsrv_readdirplus(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
goto nfsmout;
}
VOP_UNLOCK(vp, 0);
- MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK);
+ rbuf = malloc(siz, M_TEMP, M_WAITOK);
again:
iv.iov_base = rbuf;
iv.iov_len = fullsiz;
@@ -3557,8 +3557,8 @@ again:
tl += 2;
*tl++ = nfsrv_nfs_false;
*tl = nfsrv_nfs_true;
- FREE((caddr_t)cookies, M_TEMP);
- FREE((caddr_t)rbuf, M_TEMP);
+ free((caddr_t)cookies, M_TEMP);
+ free((caddr_t)rbuf, M_TEMP);
error = 0;
goto nfsmout;
}
@@ -3756,8 +3756,8 @@ invalid:
mp->m_len = bp - mtod(mp, caddr_t);
} else
mp->m_len += bp - bpos;
- FREE((caddr_t)cookies, M_TEMP);
- FREE((caddr_t)rbuf, M_TEMP);
+ free((caddr_t)cookies, M_TEMP);
+ free((caddr_t)rbuf, M_TEMP);
nfsmout:
if (vp)
vrele(vp);
diff --git a/sys/nfsserver/nfs_srvcache.c b/sys/nfsserver/nfs_srvcache.c
index a0f272b4e397..1e36a45e433d 100644
--- a/sys/nfsserver/nfs_srvcache.c
+++ b/sys/nfsserver/nfs_srvcache.c
@@ -265,7 +265,7 @@ loop:
if (rp->rc_flag & RC_REPMBUF)
m_freem(rp->rc_reply);
if (rp->rc_flag & RC_NAM)
- FREE(rp->rc_nam, M_SONAME);
+ free(rp->rc_nam, M_SONAME);
rp->rc_flag &= (RC_LOCKED | RC_WANTED);
}
TAILQ_INSERT_TAIL(&nfsrvlruhead, rp, rc_lru);
diff --git a/sys/nfsserver/nfs_srvsock.c b/sys/nfsserver/nfs_srvsock.c
index ad557d3778af..a29d8c485483 100644
--- a/sys/nfsserver/nfs_srvsock.c
+++ b/sys/nfsserver/nfs_srvsock.c
@@ -494,7 +494,7 @@ nfsrv_rcv(struct socket *so, void *arg, int waitflag)
waitflag == M_DONTWAIT ? M_NOWAIT : M_WAITOK);
if (!rec) {
if (nam)
- FREE(nam, M_SONAME);
+ free(nam, M_SONAME);
m_freem(mp);
NFSD_LOCK();
continue;
@@ -693,7 +693,7 @@ nfsrv_dorec(struct nfssvc_sock *slp, struct nfsd *nfsd,
m = rec->nr_packet;
free(rec, M_NFSRVDESC);
NFSD_UNLOCK();
- MALLOC(nd, struct nfsrv_descript *, sizeof (struct nfsrv_descript),
+ nd = malloc(sizeof (struct nfsrv_descript),
M_NFSRVDESC, M_WAITOK);
nd->nd_cr = crget();
NFSD_LOCK();
@@ -703,7 +703,7 @@ nfsrv_dorec(struct nfssvc_sock *slp, struct nfsd *nfsd,
error = nfs_getreq(nd, nfsd, TRUE);
if (error) {
if (nam) {
- FREE(nam, M_SONAME);
+ free(nam, M_SONAME);
}
if (nd->nd_cr != NULL)
crfree(nd->nd_cr);
diff --git a/sys/nfsserver/nfs_syscalls.c b/sys/nfsserver/nfs_syscalls.c
index f3b69e7863b4..23db48caea4f 100644
--- a/sys/nfsserver/nfs_syscalls.c
+++ b/sys/nfsserver/nfs_syscalls.c
@@ -202,7 +202,7 @@ nfssvc_addsock(struct file *fp, struct sockaddr *mynam)
tslp = nfs_udpsock;
if (tslp->ns_flag & SLP_VALID) {
if (mynam != NULL)
- FREE(mynam, M_SONAME);
+ free(mynam, M_SONAME);
return (EPERM);
}
}
@@ -211,7 +211,7 @@ nfssvc_addsock(struct file *fp, struct sockaddr *mynam)
error = soreserve(so, siz, siz);
if (error) {
if (mynam != NULL)
- FREE(mynam, M_SONAME);
+ free(mynam, M_SONAME);
return (error);
}
@@ -459,7 +459,7 @@ nfssvc_nfsd()
nfsrvstats.srv_errs++;
nfsrv_updatecache(nd, FALSE, mreq);
if (nd->nd_nam2)
- FREE(nd->nd_nam2, M_SONAME);
+ free(nd->nd_nam2, M_SONAME);
break;
}
nfsrvstats.srvrpccnt[nd->nd_procnum]++;
@@ -496,7 +496,7 @@ nfssvc_nfsd()
m_freem(m);
}
if (nd->nd_nam2)
- FREE(nd->nd_nam2, M_SONAME);
+ free(nd->nd_nam2, M_SONAME);
if (nd->nd_mrep)
m_freem(nd->nd_mrep);
if (error == EPIPE)
@@ -515,13 +515,13 @@ nfssvc_nfsd()
case RC_DROPIT:
m_freem(nd->nd_mrep);
if (nd->nd_nam2)
- FREE(nd->nd_nam2, M_SONAME);
+ free(nd->nd_nam2, M_SONAME);
break;
};
if (nd) {
if (nd->nd_cr != NULL)
crfree(nd->nd_cr);
- FREE((caddr_t)nd, M_NFSRVDESC);
+ free((caddr_t)nd, M_NFSRVDESC);
nd = NULL;
}
@@ -596,12 +596,12 @@ nfsrv_zapsock(struct nfssvc_sock *slp)
closef(fp, NULL);
NFSD_LOCK();
if (slp->ns_nam)
- FREE(slp->ns_nam, M_SONAME);
+ free(slp->ns_nam, M_SONAME);
m_freem(slp->ns_raw);
while ((rec = STAILQ_FIRST(&slp->ns_rec)) != NULL) {
STAILQ_REMOVE_HEAD(&slp->ns_rec, nr_link);
if (rec->nr_address)
- FREE(rec->nr_address, M_SONAME);
+ free(rec->nr_address, M_SONAME);
m_freem(rec->nr_packet);
free(rec, M_NFSRVDESC);
}
diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c
index fe7372bdf9ea..ad314fbb19b8 100644
--- a/sys/opencrypto/cryptodev.c
+++ b/sys/opencrypto/cryptodev.c
@@ -267,8 +267,7 @@ cryptof_ioctl(
goto bail;
}
- MALLOC(crie.cri_key, u_int8_t *,
- crie.cri_klen / 8, M_XDATA, M_WAITOK);
+ crie.cri_key = malloc( crie.cri_klen / 8, M_XDATA, M_WAITOK);
if ((error = copyin(sop->key, crie.cri_key,
crie.cri_klen / 8)))
goto bail;
@@ -285,8 +284,7 @@ cryptof_ioctl(
}
if (cria.cri_klen) {
- MALLOC(cria.cri_key, u_int8_t *,
- cria.cri_klen / 8, M_XDATA, M_WAITOK);
+ cria.cri_key = malloc( cria.cri_klen / 8, M_XDATA, M_WAITOK);
if ((error = copyin(sop->mackey, cria.cri_key,
cria.cri_klen / 8)))
goto bail;
@@ -322,9 +320,9 @@ cryptof_ioctl(
bail:
if (error) {
if (crie.cri_key)
- FREE(crie.cri_key, M_XDATA);
+ free(crie.cri_key, M_XDATA);
if (cria.cri_key)
- FREE(cria.cri_key, M_XDATA);
+ free(cria.cri_key, M_XDATA);
}
break;
case CIOCFSESSION:
@@ -625,7 +623,7 @@ cryptodev_key(struct crypt_kop *kop)
size = (krp->krp_param[i].crp_nbits + 7) / 8;
if (size == 0)
continue;
- MALLOC(krp->krp_param[i].crp_p, caddr_t, size, M_XDATA, M_WAITOK);
+ krp->krp_param[i].crp_p = malloc(size, M_XDATA, M_WAITOK);
if (i >= krp->krp_iparams)
continue;
error = copyin(kop->crk_param[i].crp_p, krp->krp_param[i].crp_p, size);
@@ -662,7 +660,7 @@ fail:
kop->crk_status = krp->krp_status;
for (i = 0; i < CRK_MAXPARAM; i++) {
if (krp->krp_param[i].crp_p)
- FREE(krp->krp_param[i].crp_p, M_XDATA);
+ free(krp->krp_param[i].crp_p, M_XDATA);
}
free(krp, M_XDATA);
}
@@ -731,7 +729,7 @@ cryptof_close(struct file *fp, struct thread *td)
TAILQ_REMOVE(&fcr->csessions, cse, next);
(void)csefree(cse);
}
- FREE(fcr, M_XDATA);
+ free(fcr, M_XDATA);
fp->f_data = NULL;
return 0;
}
@@ -778,10 +776,10 @@ csecreate(struct fcrypt *fcr, u_int64_t sid, caddr_t key, u_int64_t keylen,
#ifdef INVARIANTS
/* NB: required when mtx_init is built with INVARIANTS */
- MALLOC(cse, struct csession *, sizeof(struct csession),
+ cse = malloc(sizeof(struct csession),
M_XDATA, M_NOWAIT | M_ZERO);
#else
- MALLOC(cse, struct csession *, sizeof(struct csession),
+ cse = malloc(sizeof(struct csession),
M_XDATA, M_NOWAIT);
#endif
if (cse == NULL)
@@ -808,10 +806,10 @@ csefree(struct csession *cse)
error = crypto_freesession(cse->sid);
mtx_destroy(&cse->lock);
if (cse->key)
- FREE(cse->key, M_XDATA);
+ free(cse->key, M_XDATA);
if (cse->mackey)
- FREE(cse->mackey, M_XDATA);
- FREE(cse, M_XDATA);
+ free(cse->mackey, M_XDATA);
+ free(cse, M_XDATA);
return (error);
}
@@ -842,15 +840,14 @@ cryptoioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread
switch (cmd) {
case CRIOGET:
- MALLOC(fcr, struct fcrypt *,
- sizeof(struct fcrypt), M_XDATA, M_WAITOK);
+ fcr = malloc( sizeof(struct fcrypt), M_XDATA, M_WAITOK);
TAILQ_INIT(&fcr->csessions);
fcr->sesn = 0;
error = falloc(td, &f, &fd);
if (error) {
- FREE(fcr, M_XDATA);
+ free(fcr, M_XDATA);
return (error);
}
/* falloc automatically provides an extra reference to 'f'. */
diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c
index ba837185e758..d115dbc354b2 100644
--- a/sys/opencrypto/cryptosoft.c
+++ b/sys/opencrypto/cryptosoft.c
@@ -523,7 +523,7 @@ swcr_compdec(struct cryptodesc *crd, struct swcr_data *sw,
* copy in a buffer.
*/
- MALLOC(data, u_int8_t *, crd->crd_len, M_CRYPTO_DATA, M_NOWAIT);
+ data = malloc(crd->crd_len, M_CRYPTO_DATA, M_NOWAIT);
if (data == NULL)
return (EINVAL);
crypto_copydata(flags, buf, crd->crd_skip, crd->crd_len, data);
@@ -533,7 +533,7 @@ swcr_compdec(struct cryptodesc *crd, struct swcr_data *sw,
else
result = cxf->decompress(data, crd->crd_len, &out);
- FREE(data, M_CRYPTO_DATA);
+ free(data, M_CRYPTO_DATA);
if (result == 0)
return EINVAL;
@@ -545,7 +545,7 @@ swcr_compdec(struct cryptodesc *crd, struct swcr_data *sw,
if (crd->crd_flags & CRD_F_COMP) {
if (result > crd->crd_len) {
/* Compression was useless, we lost time */
- FREE(out, M_CRYPTO_DATA);
+ free(out, M_CRYPTO_DATA);
return 0;
}
}
@@ -576,7 +576,7 @@ swcr_compdec(struct cryptodesc *crd, struct swcr_data *sw,
}
}
}
- FREE(out, M_CRYPTO_DATA);
+ free(out, M_CRYPTO_DATA);
return 0;
}
@@ -635,7 +635,7 @@ swcr_newsession(device_t dev, u_int32_t *sid, struct cryptoini *cri)
*sid = i;
while (cri) {
- MALLOC(*swd, struct swcr_data *, sizeof(struct swcr_data),
+ *swd = malloc(sizeof(struct swcr_data),
M_CRYPTO_DATA, M_NOWAIT|M_ZERO);
if (*swd == NULL) {
swcr_freesession(dev, i);
@@ -873,7 +873,7 @@ swcr_freesession(device_t dev, u_int64_t tid)
break;
}
- FREE(swd, M_CRYPTO_DATA);
+ free(swd, M_CRYPTO_DATA);
}
return 0;
}
@@ -1036,7 +1036,7 @@ swcr_detach(device_t dev)
{
crypto_unregister_all(swcr_id);
if (swcr_sessions != NULL)
- FREE(swcr_sessions, M_CRYPTO_DATA);
+ free(swcr_sessions, M_CRYPTO_DATA);
}
static device_method_t swcr_methods[] = {
diff --git a/sys/opencrypto/deflate.c b/sys/opencrypto/deflate.c
index 49021d772c9d..f4b4f48ff433 100644
--- a/sys/opencrypto/deflate.c
+++ b/sys/opencrypto/deflate.c
@@ -79,7 +79,7 @@ deflate_global(data, size, decomp, out)
zbuf.avail_in = size; /* Total length of data to be processed */
if (!decomp) {
- MALLOC(buf[i].out, u_int8_t *, (u_long) size, M_CRYPTO_DATA,
+ buf[i].out = malloc((u_long) size, M_CRYPTO_DATA,
M_NOWAIT);
if (buf[i].out == NULL)
goto bad;
@@ -94,7 +94,7 @@ deflate_global(data, size, decomp, out)
* updated while the decompression is going on
*/
- MALLOC(buf[i].out, u_int8_t *, (u_long) (size * 4),
+ buf[i].out = malloc((u_long) (size * 4),
M_CRYPTO_DATA, M_NOWAIT);
if (buf[i].out == NULL)
goto bad;
@@ -121,7 +121,7 @@ deflate_global(data, size, decomp, out)
goto end;
else if (zbuf.avail_out == 0 && i < (ZBUF - 1)) {
/* we need more output space, allocate size */
- MALLOC(buf[i].out, u_int8_t *, (u_long) size,
+ buf[i].out = malloc((u_long) size,
M_CRYPTO_DATA, M_NOWAIT);
if (buf[i].out == NULL)
goto bad;
@@ -137,7 +137,7 @@ deflate_global(data, size, decomp, out)
end:
result = count = zbuf.total_out;
- MALLOC(*out, u_int8_t *, (u_long) result, M_CRYPTO_DATA, M_NOWAIT);
+ *out = malloc((u_long) result, M_CRYPTO_DATA, M_NOWAIT);
if (*out == NULL)
goto bad;
if (decomp)
@@ -149,13 +149,13 @@ end:
if (count > buf[j].size) {
bcopy(buf[j].out, *out, buf[j].size);
*out += buf[j].size;
- FREE(buf[j].out, M_CRYPTO_DATA);
+ free(buf[j].out, M_CRYPTO_DATA);
count -= buf[j].size;
} else {
/* it should be the last buffer */
bcopy(buf[j].out, *out, count);
*out += count;
- FREE(buf[j].out, M_CRYPTO_DATA);
+ free(buf[j].out, M_CRYPTO_DATA);
count = 0;
}
}
@@ -165,7 +165,7 @@ end:
bad:
*out = NULL;
for (j = 0; buf[j].flag != 0; j++)
- FREE(buf[j].out, M_CRYPTO_DATA);
+ free(buf[j].out, M_CRYPTO_DATA);
if (decomp)
inflateEnd(&zbuf);
else
diff --git a/sys/opencrypto/xform.c b/sys/opencrypto/xform.c
index 464429f122b7..1de9a1780c26 100644
--- a/sys/opencrypto/xform.c
+++ b/sys/opencrypto/xform.c
@@ -313,7 +313,7 @@ des1_setkey(u_int8_t **sched, u_int8_t *key, int len)
des_key_schedule *p;
int err;
- MALLOC(p, des_key_schedule *, sizeof (des_key_schedule),
+ p = malloc(sizeof (des_key_schedule),
M_CRYPTO_DATA, M_NOWAIT|M_ZERO);
if (p != NULL) {
des_set_key((des_cblock *) key, p[0]);
@@ -328,7 +328,7 @@ static void
des1_zerokey(u_int8_t **sched)
{
bzero(*sched, sizeof (des_key_schedule));
- FREE(*sched, M_CRYPTO_DATA);
+ free(*sched, M_CRYPTO_DATA);
*sched = NULL;
}
@@ -356,7 +356,7 @@ des3_setkey(u_int8_t **sched, u_int8_t *key, int len)
des_key_schedule *p;
int err;
- MALLOC(p, des_key_schedule *, 3*sizeof (des_key_schedule),
+ p = malloc(3*sizeof (des_key_schedule),
M_CRYPTO_DATA, M_NOWAIT|M_ZERO);
if (p != NULL) {
des_set_key((des_cblock *)(key + 0), p[0]);
@@ -373,7 +373,7 @@ static void
des3_zerokey(u_int8_t **sched)
{
bzero(*sched, 3*sizeof (des_key_schedule));
- FREE(*sched, M_CRYPTO_DATA);
+ free(*sched, M_CRYPTO_DATA);
*sched = NULL;
}
@@ -412,7 +412,7 @@ blf_setkey(u_int8_t **sched, u_int8_t *key, int len)
{
int err;
- MALLOC(*sched, u_int8_t *, sizeof(BF_KEY),
+ *sched = malloc(sizeof(BF_KEY),
M_CRYPTO_DATA, M_NOWAIT|M_ZERO);
if (*sched != NULL) {
BF_set_key((BF_KEY *) *sched, len, key);
@@ -426,7 +426,7 @@ static void
blf_zerokey(u_int8_t **sched)
{
bzero(*sched, sizeof(BF_KEY));
- FREE(*sched, M_CRYPTO_DATA);
+ free(*sched, M_CRYPTO_DATA);
*sched = NULL;
}
@@ -447,7 +447,7 @@ cast5_setkey(u_int8_t **sched, u_int8_t *key, int len)
{
int err;
- MALLOC(*sched, u_int8_t *, sizeof(cast_key), M_CRYPTO_DATA, M_NOWAIT|M_ZERO);
+ *sched = malloc(sizeof(cast_key), M_CRYPTO_DATA, M_NOWAIT|M_ZERO);
if (*sched != NULL) {
cast_setkey((cast_key *)*sched, key, len);
err = 0;
@@ -460,7 +460,7 @@ static void
cast5_zerokey(u_int8_t **sched)
{
bzero(*sched, sizeof(cast_key));
- FREE(*sched, M_CRYPTO_DATA);
+ free(*sched, M_CRYPTO_DATA);
*sched = NULL;
}
@@ -482,7 +482,7 @@ skipjack_setkey(u_int8_t **sched, u_int8_t *key, int len)
int err;
/* NB: allocate all the memory that's needed at once */
- MALLOC(*sched, u_int8_t *, 10 * (sizeof(u_int8_t *) + 0x100),
+ *sched = malloc(10 * (sizeof(u_int8_t *) + 0x100),
M_CRYPTO_DATA, M_NOWAIT|M_ZERO);
if (*sched != NULL) {
u_int8_t** key_tables = (u_int8_t**) *sched;
@@ -504,7 +504,7 @@ static void
skipjack_zerokey(u_int8_t **sched)
{
bzero(*sched, 10 * (sizeof(u_int8_t *) + 0x100));
- FREE(*sched, M_CRYPTO_DATA);
+ free(*sched, M_CRYPTO_DATA);
*sched = NULL;
}
@@ -528,7 +528,7 @@ rijndael128_setkey(u_int8_t **sched, u_int8_t *key, int len)
if (len != 16 && len != 24 && len != 32)
return (EINVAL);
- MALLOC(*sched, u_int8_t *, sizeof(rijndael_ctx), M_CRYPTO_DATA,
+ *sched = malloc(sizeof(rijndael_ctx), M_CRYPTO_DATA,
M_NOWAIT|M_ZERO);
if (*sched != NULL) {
rijndael_set_key((rijndael_ctx *) *sched, (u_char *) key,
@@ -543,7 +543,7 @@ static void
rijndael128_zerokey(u_int8_t **sched)
{
bzero(*sched, sizeof(rijndael_ctx));
- FREE(*sched, M_CRYPTO_DATA);
+ free(*sched, M_CRYPTO_DATA);
*sched = NULL;
}
@@ -567,7 +567,7 @@ cml_setkey(u_int8_t **sched, u_int8_t *key, int len)
if (len != 16 && len != 24 && len != 32)
return (EINVAL);
- MALLOC(*sched, u_int8_t *, sizeof(camellia_ctx), M_CRYPTO_DATA,
+ *sched = malloc(sizeof(camellia_ctx), M_CRYPTO_DATA,
M_NOWAIT|M_ZERO);
if (*sched != NULL) {
camellia_set_key((camellia_ctx *) *sched, (u_char *) key,
@@ -582,7 +582,7 @@ static void
cml_zerokey(u_int8_t **sched)
{
bzero(*sched, sizeof(camellia_ctx));
- FREE(*sched, M_CRYPTO_DATA);
+ free(*sched, M_CRYPTO_DATA);
*sched = NULL;
}
diff --git a/sys/rpc/rpcclnt.c b/sys/rpc/rpcclnt.c
index 54cde66b12df..1c90ff6eb52d 100644
--- a/sys/rpc/rpcclnt.c
+++ b/sys/rpc/rpcclnt.c
@@ -1029,7 +1029,7 @@ rpcclnt_reply(myrep, td)
m_freem(nam);
#else
if (nam)
- FREE(nam, M_SONAME);
+ free(nam, M_SONAME);
#endif
/*
@@ -1154,7 +1154,7 @@ rpcclnt_request(rpc, mrest, procnum, td, cred, reply)
#ifdef __OpenBSD__
task = pool_get(&rpctask_pool, PR_WAITOK);
#else
- MALLOC(task, struct rpctask *, sizeof(struct rpctask), M_RPCCLNT, (M_WAITOK | M_ZERO));
+ task = malloc(sizeof(struct rpctask), M_RPCCLNT, (M_WAITOK | M_ZERO));
#endif
task->r_rpcclnt = rpc;
@@ -1172,7 +1172,7 @@ rpcclnt_request(rpc, mrest, procnum, td, cred, reply)
#ifdef __OpenBSD__
pool_put(&rpctask_pool, task);
#else
- FREE(task, M_RPCCLNT);
+ free(task, M_RPCCLNT);
#endif
error = EPROTONOSUPPORT;
goto rpcmout;
@@ -1294,7 +1294,7 @@ rpcclnt_request(rpc, mrest, procnum, td, cred, reply)
#ifdef __OpenBSD__
pool_put(&rpctask_pool, task);
#else
- FREE(task, M_RPCCLNT);
+ free(task, M_RPCCLNT);
#endif
if (error)
@@ -2025,7 +2025,7 @@ rpcclnt_softterm(struct rpctask * task)
void
rpcclnt_create(struct rpcclnt ** rpc)
{
- MALLOC(*rpc, struct rpcclnt *, sizeof(struct rpcclnt), M_RPCCLNT, M_WAITOK | M_ZERO);
+ *rpc = malloc(sizeof(struct rpcclnt), M_RPCCLNT, M_WAITOK | M_ZERO);
}
/* called by rpcclnt_put() */
@@ -2033,7 +2033,7 @@ void
rpcclnt_destroy(struct rpcclnt * rpc)
{
if (rpc != NULL) {
- FREE(rpc, M_RPCCLNT);
+ free(rpc, M_RPCCLNT);
} else {
RPCDEBUG("attempting to free a NULL rpcclnt (not dereferenced)");
}
diff --git a/sys/security/mac_bsdextended/mac_bsdextended.c b/sys/security/mac_bsdextended/mac_bsdextended.c
index 93befaee7552..e9d7901b4492 100644
--- a/sys/security/mac_bsdextended/mac_bsdextended.c
+++ b/sys/security/mac_bsdextended/mac_bsdextended.c
@@ -152,8 +152,7 @@ sysctl_rule(SYSCTL_HANDLER_ARGS)
error = SYSCTL_IN(req, &temprule, sizeof(temprule));
if (error)
return (error);
- MALLOC(ruleptr, struct mac_bsdextended_rule *,
- sizeof(*ruleptr), M_MACBSDEXTENDED, M_WAITOK | M_ZERO);
+ ruleptr = malloc( sizeof(*ruleptr), M_MACBSDEXTENDED, M_WAITOK | M_ZERO);
}
mtx_lock(&ugidfw_mtx);
@@ -194,7 +193,7 @@ sysctl_rule(SYSCTL_HANDLER_ARGS)
out:
mtx_unlock(&ugidfw_mtx);
if (ruleptr != NULL)
- FREE(ruleptr, M_MACBSDEXTENDED);
+ free(ruleptr, M_MACBSDEXTENDED);
if (req->oldptr && error == 0)
error = SYSCTL_OUT(req, &temprule, sizeof(temprule));
return (error);
diff --git a/sys/security/mac_lomac/mac_lomac.c b/sys/security/mac_lomac/mac_lomac.c
index 2781366b3b27..1e7bc99b040d 100644
--- a/sys/security/mac_lomac/mac_lomac.c
+++ b/sys/security/mac_lomac/mac_lomac.c
@@ -1866,7 +1866,7 @@ lomac_proc_destroy_label(struct label *label)
{
mtx_destroy(&PSLOT(label)->mtx);
- FREE(PSLOT(label), M_LOMAC);
+ free(PSLOT(label), M_LOMAC);
PSLOT_SET(label, NULL);
}
diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h
index 33b287f83d92..2c646de8694b 100644
--- a/sys/sys/malloc.h
+++ b/sys/sys/malloc.h
@@ -167,13 +167,6 @@ MALLOC_DECLARE(M_IP6OPT); /* for INET6 */
MALLOC_DECLARE(M_IP6NDP); /* for INET6 */
/*
- * Deprecated macro versions of not-quite-malloc() and free().
- */
-#define MALLOC(space, cast, size, type, flags) \
- ((space) = (cast)malloc((u_long)(size), (type), (flags)))
-#define FREE(addr, type) free((addr), (type))
-
-/*
* XXX this should be declared in <sys/uio.h>, but that tends to fail
* because <sys/uio.h> is included in a header before the source file
* has a chance to include <sys/malloc.h> to get MALLOC_DECLARE() defined.
diff --git a/sys/sys/param.h b/sys/sys/param.h
index 43ea950e02bc..09c38ccebdad 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -57,7 +57,7 @@
* is created, otherwise 1.
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 800050 /* Master, propagated to newvers */
+#define __FreeBSD_version 800051 /* Master, propagated to newvers */
#ifndef LOCORE
#include <sys/types.h>
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index bb3a48ce9bd1..fa679ef1f812 100644
--- a/sys/ufs/ffs/ffs_inode.c
+++ b/sys/ufs/ffs/ffs_inode.c
@@ -583,7 +583,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp)
else
bap2 = (ufs2_daddr_t *)bp->b_data;
if (lastbn != -1) {
- MALLOC(copy, caddr_t, fs->fs_bsize, M_TEMP, M_WAITOK);
+ copy = malloc(fs->fs_bsize, M_TEMP, M_WAITOK);
bcopy((caddr_t)bp->b_data, copy, (u_int)fs->fs_bsize);
for (i = last + 1; i < NINDIR(fs); i++)
if (ip->i_ump->um_fstype == UFS1)
@@ -637,7 +637,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp)
}
}
if (copy != NULL) {
- FREE(copy, M_TEMP);
+ free(copy, M_TEMP);
} else {
bp->b_flags |= B_INVAL | B_NOCACHE;
brelse(bp);
diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c
index 20fbefc85b1c..bb39bd6eca1e 100644
--- a/sys/ufs/ffs/ffs_snapshot.c
+++ b/sys/ufs/ffs/ffs_snapshot.c
@@ -361,7 +361,7 @@ restart:
* the suspension period.
*/
len = howmany(fs->fs_ncg, NBBY);
- MALLOC(space, void *, len, M_DEVBUF, M_WAITOK|M_ZERO);
+ space = malloc(len, M_DEVBUF, M_WAITOK|M_ZERO);
UFS_LOCK(ump);
fs->fs_active = space;
UFS_UNLOCK(ump);
@@ -626,7 +626,7 @@ loop:
* keep us out of deadlock until the full one is ready.
*/
if (xp == NULL) {
- MALLOC(snapblklist, daddr_t *, snaplistsize * sizeof(daddr_t),
+ snapblklist = malloc(snaplistsize * sizeof(daddr_t),
M_UFSMNT, M_WAITOK);
blkp = &snapblklist[1];
*blkp++ = lblkno(fs, fs->fs_sblockloc);
@@ -707,7 +707,7 @@ out1:
/*
* Allocate space for the full list of preallocated snapshot blocks.
*/
- MALLOC(snapblklist, daddr_t *, snaplistsize * sizeof(daddr_t),
+ snapblklist = malloc(snaplistsize * sizeof(daddr_t),
M_UFSMNT, M_WAITOK);
ip->i_snapblklist = &snapblklist[1];
/*
@@ -721,7 +721,7 @@ out1:
error = expunge_ufs2(vp, ip, copy_fs, mapacct_ufs2, BLK_SNAP);
if (error) {
fs->fs_snapinum[snaploc] = 0;
- FREE(snapblklist, M_UFSMNT);
+ free(snapblklist, M_UFSMNT);
goto done;
}
if (snaplistsize < ip->i_snapblklist - snapblklist)
@@ -743,7 +743,7 @@ out1:
auio.uio_td = td;
if ((error = VOP_WRITE(vp, &auio, IO_UNIT, td->td_ucred)) != 0) {
fs->fs_snapinum[snaploc] = 0;
- FREE(snapblklist, M_UFSMNT);
+ free(snapblklist, M_UFSMNT);
goto done;
}
/*
@@ -758,7 +758,7 @@ out1:
if (error) {
brelse(nbp);
fs->fs_snapinum[snaploc] = 0;
- FREE(snapblklist, M_UFSMNT);
+ free(snapblklist, M_UFSMNT);
goto done;
}
bcopy(space, nbp->b_data, fs->fs_bsize);
@@ -775,7 +775,7 @@ out1:
sn->sn_listsize = snaplistsize;
VI_UNLOCK(devvp);
if (space != NULL)
- FREE(space, M_UFSMNT);
+ free(space, M_UFSMNT);
/*
* If another process is currently writing the buffer containing
* the inode for this snapshot then a deadlock can occur. Drop
@@ -793,7 +793,7 @@ out1:
else
vrele(vp); /* Drop extra reference */
done:
- FREE(copy_fs->fs_csp, M_UFSMNT);
+ free(copy_fs->fs_csp, M_UFSMNT);
bawrite(sbp);
out:
NDFREE(&nd, NDF_ONLY_PNBUF);
@@ -807,7 +807,7 @@ out:
}
UFS_LOCK(ump);
if (fs->fs_active != 0) {
- FREE(fs->fs_active, M_DEVBUF);
+ free(fs->fs_active, M_DEVBUF);
fs->fs_active = 0;
}
UFS_UNLOCK(ump);
@@ -1090,7 +1090,7 @@ indiracct_ufs1(snapvp, cancelvp, level, blkno, lbn, rlbn, remblks,
last = howmany(remblks, blksperindir);
if (last > NINDIR(fs))
last = NINDIR(fs);
- MALLOC(bap, ufs1_daddr_t *, fs->fs_bsize, M_DEVBUF, M_WAITOK);
+ bap = malloc(fs->fs_bsize, M_DEVBUF, M_WAITOK);
bcopy(bp->b_data, (caddr_t)bap, fs->fs_bsize);
bqrelse(bp);
error = (*acctfunc)(snapvp, &bap[0], &bap[last], fs,
@@ -1112,7 +1112,7 @@ indiracct_ufs1(snapvp, cancelvp, level, blkno, lbn, rlbn, remblks,
remblks -= blksperindir;
}
out:
- FREE(bap, M_DEVBUF);
+ free(bap, M_DEVBUF);
return (error);
}
@@ -1370,7 +1370,7 @@ indiracct_ufs2(snapvp, cancelvp, level, blkno, lbn, rlbn, remblks,
last = howmany(remblks, blksperindir);
if (last > NINDIR(fs))
last = NINDIR(fs);
- MALLOC(bap, ufs2_daddr_t *, fs->fs_bsize, M_DEVBUF, M_WAITOK);
+ bap = malloc(fs->fs_bsize, M_DEVBUF, M_WAITOK);
bcopy(bp->b_data, (caddr_t)bap, fs->fs_bsize);
bqrelse(bp);
error = (*acctfunc)(snapvp, &bap[0], &bap[last], fs,
@@ -1392,7 +1392,7 @@ indiracct_ufs2(snapvp, cancelvp, level, blkno, lbn, rlbn, remblks,
remblks -= blksperindir;
}
out:
- FREE(bap, M_DEVBUF);
+ free(bap, M_DEVBUF);
return (error);
}
@@ -1979,7 +1979,7 @@ ffs_snapshot_mount(mp)
VOP_UNLOCK(vp, 0);
return;
}
- MALLOC(snapblklist, void *, snaplistsize * sizeof(daddr_t),
+ snapblklist = malloc(snaplistsize * sizeof(daddr_t),
M_UFSMNT, M_WAITOK);
auio.uio_iovcnt = 1;
aiov.iov_base = snapblklist;
@@ -1989,7 +1989,7 @@ ffs_snapshot_mount(mp)
if ((error = VOP_READ(vp, &auio, IO_UNIT, td->td_ucred)) != 0) {
printf("ffs_snapshot_mount: read_2 failed %d\n", error);
VOP_UNLOCK(vp, 0);
- FREE(snapblklist, M_UFSMNT);
+ free(snapblklist, M_UFSMNT);
return;
}
VOP_UNLOCK(vp, 0);
@@ -2525,7 +2525,7 @@ try_free_snapdata(struct vnode *devvp)
sn->sn_listsize = 0;
lockmgr(&sn->sn_lock, LK_RELEASE, NULL);
if (snapblklist != NULL)
- FREE(snapblklist, M_UFSMNT);
+ free(snapblklist, M_UFSMNT);
ffs_snapdata_free(sn);
}
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 3c9a90652990..460c1dfdc39e 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -630,7 +630,7 @@ workitem_free(item, type)
ump = VFSTOUFS(item->wk_mp);
if (--ump->softdep_deps == 0 && ump->softdep_req)
wakeup(&ump->softdep_deps);
- FREE(item, DtoM(type));
+ free(item, DtoM(type));
}
static void
@@ -1216,7 +1216,7 @@ pagedep_lookup(ip, lbn, flags, pagedeppp)
if (*pagedeppp || (flags & DEPALLOC) == 0)
return (ret);
FREE_LOCK(&lk);
- MALLOC(pagedep, struct pagedep *, sizeof(struct pagedep),
+ pagedep = malloc(sizeof(struct pagedep),
M_PAGEDEP, M_SOFTDEP_FLAGS|M_ZERO);
workitem_alloc(&pagedep->pd_list, D_PAGEDEP, mp);
ACQUIRE_LOCK(&lk);
@@ -1296,7 +1296,7 @@ inodedep_lookup(mp, inum, flags, inodedeppp)
if (num_inodedep > max_softdeps && (flags & NODELAY) == 0)
request_cleanup(mp, FLUSH_INODES);
FREE_LOCK(&lk);
- MALLOC(inodedep, struct inodedep *, sizeof(struct inodedep),
+ inodedep = malloc(sizeof(struct inodedep),
M_INODEDEP, M_SOFTDEP_FLAGS);
workitem_alloc(&inodedep->id_list, D_INODEDEP, mp);
ACQUIRE_LOCK(&lk);
@@ -1374,11 +1374,11 @@ newblk_lookup(fs, newblkno, flags, newblkpp)
if ((flags & DEPALLOC) == 0)
return (0);
FREE_LOCK(&lk);
- MALLOC(newblk, struct newblk *, sizeof(struct newblk),
+ newblk = malloc(sizeof(struct newblk),
M_NEWBLK, M_SOFTDEP_FLAGS);
ACQUIRE_LOCK(&lk);
if (newblk_find(newblkhd, fs, newblkno, newblkpp)) {
- FREE(newblk, M_NEWBLK);
+ free(newblk, M_NEWBLK);
return (1);
}
newblk->nb_state = 0;
@@ -1600,7 +1600,7 @@ bmsafemap_lookup(mp, bp)
if (wk->wk_type == D_BMSAFEMAP)
return (WK_BMSAFEMAP(wk));
FREE_LOCK(&lk);
- MALLOC(bmsafemap, struct bmsafemap *, sizeof(struct bmsafemap),
+ bmsafemap = malloc(sizeof(struct bmsafemap),
M_BMSAFEMAP, M_SOFTDEP_FLAGS);
workitem_alloc(&bmsafemap->sm_list, D_BMSAFEMAP, mp);
bmsafemap->sm_buf = bp;
@@ -1661,7 +1661,7 @@ softdep_setup_allocdirect(ip, lbn, newblkno, oldblkno, newsize, oldsize, bp)
struct mount *mp;
mp = UFSTOVFS(ip->i_ump);
- MALLOC(adp, struct allocdirect *, sizeof(struct allocdirect),
+ adp = malloc(sizeof(struct allocdirect),
M_ALLOCDIRECT, M_SOFTDEP_FLAGS|M_ZERO);
workitem_alloc(&adp->ad_list, D_ALLOCDIRECT, mp);
adp->ad_lbn = lbn;
@@ -1705,7 +1705,7 @@ softdep_setup_allocdirect(ip, lbn, newblkno, oldblkno, newsize, oldsize, bp)
LIST_INSERT_HEAD(&bmsafemap->sm_allocdirecthd, adp, ad_deps);
}
LIST_REMOVE(newblk, nb_hash);
- FREE(newblk, M_NEWBLK);
+ free(newblk, M_NEWBLK);
inodedep_lookup(mp, ip->i_number, DEPALLOC | NODELAY, &inodedep);
adp->ad_inodedep = inodedep;
@@ -1822,7 +1822,7 @@ newfreefrag(ip, blkno, size)
fs = ip->i_fs;
if (fragnum(fs, blkno) + numfrags(fs, size) > fs->fs_frag)
panic("newfreefrag: frag size");
- MALLOC(freefrag, struct freefrag *, sizeof(struct freefrag),
+ freefrag = malloc(sizeof(struct freefrag),
M_FREEFRAG, M_SOFTDEP_FLAGS);
workitem_alloc(&freefrag->ff_list, D_FREEFRAG, UFSTOVFS(ip->i_ump));
freefrag->ff_inum = ip->i_number;
@@ -1871,7 +1871,7 @@ softdep_setup_allocext(ip, lbn, newblkno, oldblkno, newsize, oldsize, bp)
struct mount *mp;
mp = UFSTOVFS(ip->i_ump);
- MALLOC(adp, struct allocdirect *, sizeof(struct allocdirect),
+ adp = malloc(sizeof(struct allocdirect),
M_ALLOCDIRECT, M_SOFTDEP_FLAGS|M_ZERO);
workitem_alloc(&adp->ad_list, D_ALLOCDIRECT, mp);
adp->ad_lbn = lbn;
@@ -1903,7 +1903,7 @@ softdep_setup_allocext(ip, lbn, newblkno, oldblkno, newsize, oldsize, bp)
LIST_INSERT_HEAD(&bmsafemap->sm_allocdirecthd, adp, ad_deps);
}
LIST_REMOVE(newblk, nb_hash);
- FREE(newblk, M_NEWBLK);
+ free(newblk, M_NEWBLK);
WORKLIST_INSERT(&bp->b_dep, &adp->ad_list);
if (lbn >= NXADDR)
@@ -1981,7 +1981,7 @@ newallocindir(ip, ptrno, newblkno, oldblkno)
{
struct allocindir *aip;
- MALLOC(aip, struct allocindir *, sizeof(struct allocindir),
+ aip = malloc(sizeof(struct allocindir),
M_ALLOCINDIR, M_SOFTDEP_FLAGS|M_ZERO);
workitem_alloc(&aip->ai_list, D_ALLOCINDIR, UFSTOVFS(ip->i_ump));
aip->ai_state = ATTACHED;
@@ -2095,7 +2095,7 @@ setup_allocindir_phase2(bp, ip, aip)
aip, ai_deps);
}
LIST_REMOVE(newblk, nb_hash);
- FREE(newblk, M_NEWBLK);
+ free(newblk, M_NEWBLK);
aip->ai_indirdep = indirdep;
/*
* Check to see if there is an existing dependency
@@ -2144,7 +2144,7 @@ setup_allocindir_phase2(bp, ip, aip)
ACQUIRE_LOCK(&lk);
break;
}
- MALLOC(newindirdep, struct indirdep *, sizeof(struct indirdep),
+ newindirdep = malloc(sizeof(struct indirdep),
M_INDIRDEP, M_SOFTDEP_FLAGS);
workitem_alloc(&newindirdep->ir_list, D_INDIRDEP,
UFSTOVFS(ip->i_ump));
@@ -2216,7 +2216,7 @@ softdep_setup_freeblocks(ip, length, flags)
mp = UFSTOVFS(ip->i_ump);
if (length != 0)
panic("softdep_setup_freeblocks: non-zero length");
- MALLOC(freeblks, struct freeblks *, sizeof(struct freeblks),
+ freeblks = malloc(sizeof(struct freeblks),
M_FREEBLKS, M_SOFTDEP_FLAGS|M_ZERO);
workitem_alloc(&freeblks->fb_list, D_FREEBLKS, mp);
freeblks->fb_state = ATTACHED;
@@ -2597,7 +2597,7 @@ softdep_freefile(pvp, ino, mode)
/*
* This sets up the inode de-allocation dependency.
*/
- MALLOC(freefile, struct freefile *, sizeof(struct freefile),
+ freefile = malloc(sizeof(struct freefile),
M_FREEFILE, M_SOFTDEP_FLAGS);
workitem_alloc(&freefile->fx_list, D_FREEFILE, pvp->v_mount);
freefile->fx_mode = mode;
@@ -2674,7 +2674,7 @@ check_inode_unwritten(inodedep)
if (inodedep->id_state & ONWORKLIST)
WORKLIST_REMOVE(&inodedep->id_list);
if (inodedep->id_savedino1 != NULL) {
- FREE(inodedep->id_savedino1, M_SAVEDINO);
+ free(inodedep->id_savedino1, M_SAVEDINO);
inodedep->id_savedino1 = NULL;
}
if (free_inodedep(inodedep) == 0)
@@ -3011,14 +3011,14 @@ softdep_setup_directory_add(bp, dp, diroffset, newinum, newdirbp, isnewblk)
fs = dp->i_fs;
lbn = lblkno(fs, diroffset);
offset = blkoff(fs, diroffset);
- MALLOC(dap, struct diradd *, sizeof(struct diradd), M_DIRADD,
+ dap = malloc(sizeof(struct diradd), M_DIRADD,
M_SOFTDEP_FLAGS|M_ZERO);
workitem_alloc(&dap->da_list, D_DIRADD, mp);
dap->da_offset = offset;
dap->da_newinum = newinum;
dap->da_state = ATTACHED;
if (isnewblk && lbn < NDADDR && fragoff(fs, diroffset) == 0) {
- MALLOC(newdirblk, struct newdirblk *, sizeof(struct newdirblk),
+ newdirblk = malloc(sizeof(struct newdirblk),
M_NEWDIRBLK, M_SOFTDEP_FLAGS);
workitem_alloc(&newdirblk->db_list, D_NEWDIRBLK, mp);
}
@@ -3027,12 +3027,12 @@ softdep_setup_directory_add(bp, dp, diroffset, newinum, newdirbp, isnewblk)
ACQUIRE_LOCK(&lk);
} else {
dap->da_state |= MKDIR_BODY | MKDIR_PARENT;
- MALLOC(mkdir1, struct mkdir *, sizeof(struct mkdir), M_MKDIR,
+ mkdir1 = malloc(sizeof(struct mkdir), M_MKDIR,
M_SOFTDEP_FLAGS);
workitem_alloc(&mkdir1->md_list, D_MKDIR, mp);
mkdir1->md_state = MKDIR_BODY;
mkdir1->md_diradd = dap;
- MALLOC(mkdir2, struct mkdir *, sizeof(struct mkdir), M_MKDIR,
+ mkdir2 = malloc(sizeof(struct mkdir), M_MKDIR,
M_SOFTDEP_FLAGS);
workitem_alloc(&mkdir2->md_list, D_MKDIR, mp);
mkdir2->md_state = MKDIR_PARENT;
@@ -3313,7 +3313,7 @@ newdirrem(bp, dp, ip, isrmdir, prevdirremp)
(void) request_cleanup(ITOV(dp)->v_mount, FLUSH_REMOVE);
num_dirrem += 1;
FREE_LOCK(&lk);
- MALLOC(dirrem, struct dirrem *, sizeof(struct dirrem),
+ dirrem = malloc(sizeof(struct dirrem),
M_DIRREM, M_SOFTDEP_FLAGS|M_ZERO);
workitem_alloc(&dirrem->dm_list, D_DIRREM, ITOV(dp)->v_mount);
dirrem->dm_state = isrmdir ? RMDIR : 0;
@@ -3410,7 +3410,7 @@ softdep_setup_directory_change(bp, dp, ip, newinum, isrmdir)
* Whiteouts do not need diradd dependencies.
*/
if (newinum != WINO) {
- MALLOC(dap, struct diradd *, sizeof(struct diradd),
+ dap = malloc(sizeof(struct diradd),
M_DIRADD, M_SOFTDEP_FLAGS|M_ZERO);
workitem_alloc(&dap->da_list, D_DIRADD, mp);
dap->da_state = DIRCHG | ATTACHED | DEPCOMPLETE;
@@ -3812,7 +3812,7 @@ softdep_disk_io_initiation(bp)
* Replace up-to-date version with safe version.
*/
FREE_LOCK(&lk);
- MALLOC(indirdep->ir_saveddata, caddr_t, bp->b_bcount,
+ indirdep->ir_saveddata = malloc(bp->b_bcount,
M_INDIRDEP, M_SOFTDEP_FLAGS);
ACQUIRE_LOCK(&lk);
indirdep->ir_state &= ~ATTACHED;
@@ -3920,8 +3920,7 @@ initiate_write_inodeblock_ufs1(inodedep, bp)
if (inodedep->id_savedino1 != NULL)
panic("initiate_write_inodeblock_ufs1: I/O underway");
FREE_LOCK(&lk);
- MALLOC(sip, struct ufs1_dinode *,
- sizeof(struct ufs1_dinode), M_SAVEDINO, M_SOFTDEP_FLAGS);
+ sip = malloc( sizeof(struct ufs1_dinode), M_SAVEDINO, M_SOFTDEP_FLAGS);
ACQUIRE_LOCK(&lk);
inodedep->id_savedino1 = sip;
*inodedep->id_savedino1 = *dp;
@@ -4066,8 +4065,7 @@ initiate_write_inodeblock_ufs2(inodedep, bp)
if (inodedep->id_savedino2 != NULL)
panic("initiate_write_inodeblock_ufs2: I/O underway");
FREE_LOCK(&lk);
- MALLOC(sip, struct ufs2_dinode *,
- sizeof(struct ufs2_dinode), M_SAVEDINO, M_SOFTDEP_FLAGS);
+ sip = malloc( sizeof(struct ufs2_dinode), M_SAVEDINO, M_SOFTDEP_FLAGS);
ACQUIRE_LOCK(&lk);
inodedep->id_savedino2 = sip;
*inodedep->id_savedino2 = *dp;
@@ -4335,7 +4333,7 @@ softdep_disk_write_complete(bp)
if (indirdep->ir_state & GOINGAWAY)
panic("disk_write_complete: indirdep gone");
bcopy(indirdep->ir_saveddata, bp->b_data, bp->b_bcount);
- FREE(indirdep->ir_saveddata, M_INDIRDEP);
+ free(indirdep->ir_saveddata, M_INDIRDEP);
indirdep->ir_saveddata = 0;
indirdep->ir_state &= ~UNDONE;
indirdep->ir_state |= ATTACHED;
@@ -4522,7 +4520,7 @@ handle_written_inodeblock(inodedep, bp)
*dp1 = *inodedep->id_savedino1;
else
*dp2 = *inodedep->id_savedino2;
- FREE(inodedep->id_savedino1, M_SAVEDINO);
+ free(inodedep->id_savedino1, M_SAVEDINO);
inodedep->id_savedino1 = NULL;
if ((bp->b_flags & B_DELWRI) == 0)
stat_inode_bitmap++;
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 483ad3341edf..6e66c883d2c8 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1404,7 +1404,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags)
fs = ump->um_fs;
/*
- * If this MALLOC() is performed after the getnewvnode()
+ * If this malloc() is performed after the getnewvnode()
* it might block, leaving a vnode with a NULL v_data to be
* found by ffs_sync() if a sync happens to fire right then,
* which will cause a panic because ffs_sync() blindly
diff --git a/sys/ufs/ufs/ufs_dirhash.c b/sys/ufs/ufs/ufs_dirhash.c
index 0042ec0c2814..cabb09c26c0d 100644
--- a/sys/ufs/ufs/ufs_dirhash.c
+++ b/sys/ufs/ufs/ufs_dirhash.c
@@ -176,7 +176,7 @@ ufsdirhash_create(struct inode *ip)
for (;;) {
/* Racy check for i_dirhash to prefetch an dirhash structure. */
if (ip->i_dirhash == NULL && ndh == NULL) {
- MALLOC(ndh, struct dirhash *, sizeof *dh, M_DIRHASH,
+ ndh = malloc(sizeof *dh, M_DIRHASH,
M_NOWAIT | M_ZERO);
if (ndh == NULL)
return (NULL);
@@ -377,11 +377,11 @@ ufsdirhash_build(struct inode *ip)
* Use non-blocking mallocs so that we will revert to a linear
* lookup on failure rather than potentially blocking forever.
*/
- MALLOC(dh->dh_hash, doff_t **, narrays * sizeof(dh->dh_hash[0]),
+ dh->dh_hash = malloc(narrays * sizeof(dh->dh_hash[0]),
M_DIRHASH, M_NOWAIT | M_ZERO);
if (dh->dh_hash == NULL)
goto fail;
- MALLOC(dh->dh_blkfree, u_int8_t *, nblocks * sizeof(dh->dh_blkfree[0]),
+ dh->dh_blkfree = malloc(nblocks * sizeof(dh->dh_blkfree[0]),
M_DIRHASH, M_NOWAIT);
if (dh->dh_blkfree == NULL)
goto fail;
@@ -485,9 +485,9 @@ ufsdirhash_free_locked(struct inode *ip)
for (i = 0; i < dh->dh_narrays; i++)
if (dh->dh_hash[i] != NULL)
DIRHASH_BLKFREE(dh->dh_hash[i]);
- FREE(dh->dh_hash, M_DIRHASH);
+ free(dh->dh_hash, M_DIRHASH);
if (dh->dh_blkfree != NULL)
- FREE(dh->dh_blkfree, M_DIRHASH);
+ free(dh->dh_blkfree, M_DIRHASH);
}
/*
@@ -1174,8 +1174,8 @@ ufsdirhash_recycle(int wanted)
DIRHASHLIST_UNLOCK();
for (i = 0; i < narrays; i++)
DIRHASH_BLKFREE(hash[i]);
- FREE(hash, M_DIRHASH);
- FREE(blkfree, M_DIRHASH);
+ free(hash, M_DIRHASH);
+ free(blkfree, M_DIRHASH);
/* Account for the returned memory, and repeat if necessary. */
DIRHASHLIST_LOCK();
diff --git a/sys/ufs/ufs/ufs_extattr.c b/sys/ufs/ufs/ufs_extattr.c
index f034e2bf639e..88f955bab6ee 100644
--- a/sys/ufs/ufs/ufs_extattr.c
+++ b/sys/ufs/ufs/ufs_extattr.c
@@ -365,7 +365,7 @@ ufs_extattr_iterate_directory(struct ufsmount *ump, struct vnode *dvp,
if (dvp->v_type != VDIR)
return (ENOTDIR);
- MALLOC(dirbuf, char *, DIRBLKSIZ, M_TEMP, M_WAITOK);
+ dirbuf = malloc(DIRBLKSIZ, M_TEMP, M_WAITOK);
auio.uio_iov = &aiov;
auio.uio_iovcnt = 1;
@@ -436,7 +436,7 @@ ufs_extattr_iterate_directory(struct ufsmount *ump, struct vnode *dvp,
break;
}
}
- FREE(dirbuf, M_TEMP);
+ free(dirbuf, M_TEMP);
return (0);
}
@@ -588,8 +588,7 @@ ufs_extattr_enable(struct ufsmount *ump, int attrnamespace,
if (backing_vnode->v_type != VREG)
return (EINVAL);
- MALLOC(attribute, struct ufs_extattr_list_entry *,
- sizeof(struct ufs_extattr_list_entry), M_UFS_EXTATTR, M_WAITOK);
+ attribute = malloc( sizeof(struct ufs_extattr_list_entry), M_UFS_EXTATTR, M_WAITOK);
if (attribute == NULL)
return (ENOMEM);
@@ -658,7 +657,7 @@ unlock_free_exit:
VOP_UNLOCK(backing_vnode, 0);
free_exit:
- FREE(attribute, M_UFS_EXTATTR);
+ free(attribute, M_UFS_EXTATTR);
return (error);
}
@@ -687,7 +686,7 @@ ufs_extattr_disable(struct ufsmount *ump, int attrnamespace,
error = vn_close(uele->uele_backing_vnode, FREAD|FWRITE,
td->td_ucred, td);
- FREE(uele, M_UFS_EXTATTR);
+ free(uele, M_UFS_EXTATTR);
return (error);
}
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 12fd13bbadb3..40304bcb5c6f 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -1890,7 +1890,7 @@ ufs_readdir(ap)
auio.uio_iovcnt = 1;
auio.uio_segflg = UIO_SYSSPACE;
aiov.iov_len = count;
- MALLOC(dirbuf, caddr_t, count, M_TEMP, M_WAITOK);
+ dirbuf = malloc(count, M_TEMP, M_WAITOK);
aiov.iov_base = dirbuf;
error = VOP_READ(ap->a_vp, &auio, 0, ap->a_cred);
if (error == 0) {
@@ -1911,7 +1911,7 @@ ufs_readdir(ap)
if (dp >= edp)
error = uiomove(dirbuf, readcnt, uio);
}
- FREE(dirbuf, M_TEMP);
+ free(dirbuf, M_TEMP);
}
# else
error = VOP_READ(ap->a_vp, uio, 0, ap->a_cred);
@@ -1933,7 +1933,7 @@ ufs_readdir(ap)
dp < dpEnd;
dp = (struct dirent *)((caddr_t) dp + dp->d_reclen))
ncookies++;
- MALLOC(cookies, u_long *, ncookies * sizeof(u_long), M_TEMP,
+ cookies = malloc(ncookies * sizeof(u_long), M_TEMP,
M_WAITOK);
for (dp = dpStart, cookiep = cookies;
dp < dpEnd;