summaryrefslogtreecommitdiff
path: root/sys/ntfs
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-10-03 10:52:12 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-10-03 10:52:12 +0000
commit91e049d131acb98a8b3ff54ab8f882b27b354479 (patch)
tree2ccb5b9450d014d6731c31bc458bcc57a8a15916 /sys/ntfs
parenta2f23a0f4539991c8472613441751eead15267e9 (diff)
MALLOC+bzero -> malloc+M_ZERO.
In ip_esp.c all allocated memory is now zero'd in the "malloc(sizeof(*tc) + alen ..." case. The +alen memory was not initialized by the bzero() call. Noticed by chl@. "Looks good" art@ "seems ok" chl@
Diffstat (limited to 'sys/ntfs')
-rw-r--r--sys/ntfs/ntfs_subr.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/ntfs/ntfs_subr.c b/sys/ntfs/ntfs_subr.c
index 24891e564a1..bd2a5b8682d 100644
--- a/sys/ntfs/ntfs_subr.c
+++ b/sys/ntfs/ntfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntfs_subr.c,v 1.11 2007/06/02 01:02:56 deraadt Exp $ */
+/* $OpenBSD: ntfs_subr.c,v 1.12 2007/10/03 10:52:11 krw Exp $ */
/* $NetBSD: ntfs_subr.c,v 1.4 2003/04/10 21:37:32 jdolecek Exp $ */
/*-
@@ -435,10 +435,8 @@ ntfs_ntlookup(
}
} while (lockmgr(&ntfs_hashlock, LK_EXCLUSIVE | LK_SLEEPFAIL, NULL));
- MALLOC(ip, struct ntnode *, sizeof(struct ntnode),
- M_NTFSNTNODE, M_WAITOK);
+ ip = malloc(sizeof(*ip), M_NTFSNTNODE, M_WAITOK | M_ZERO);
ddprintf(("ntfs_ntlookup: allocating ntnode: %d: %p\n", ino, ip));
- bzero((caddr_t) ip, sizeof(struct ntnode));
/* Generic initialization */
ip->i_devvp = ntmp->ntm_devvp;
@@ -584,9 +582,7 @@ ntfs_attrtontvattr(
error = 0;
*rvapp = NULL;
- MALLOC(vap, struct ntvattr *, sizeof(struct ntvattr),
- M_NTFSNTVATTR, M_WAITOK);
- bzero(vap, sizeof(struct ntvattr));
+ vap = malloc(sizeof(*vap), M_NTFSNTVATTR, M_WAITOK | M_ZERO);
vap->va_ip = NULL;
vap->va_flag = rap->a_hdr.a_flag;
vap->va_type = rap->a_hdr.a_type;
@@ -794,8 +790,7 @@ ntfs_fget(
if (*fpp)
return (0);
- MALLOC(fp, struct fnode *, sizeof(struct fnode), M_NTFSFNODE, M_WAITOK);
- bzero(fp, sizeof(struct fnode));
+ fp = malloc(sizeof(*fp), M_NTFSFNODE, M_WAITOK | M_ZERO);
dprintf(("ntfs_fget: allocating fnode: %p\n",fp));
fp->f_ip = ip;