summaryrefslogtreecommitdiff
path: root/sys/ufs/ffs
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-07-13 23:33:27 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-07-13 23:33:27 +0000
commita1738f65db11be6a3f7b4d589271bebd1b779de6 (patch)
treea52dcdb6165e5158e316738ad3354be9083e1247 /sys/ufs/ffs
parent1e48890c1396995bac4d0a65aa5f4dcfe62575db (diff)
pass correct sizes to free()
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r--sys/ufs/ffs/ffs_inode.c4
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c14
2 files changed, 9 insertions, 9 deletions
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index 28c8212971c..ae33ed56b3a 100644
--- a/sys/ufs/ffs/ffs_inode.c
+++ b/sys/ufs/ffs/ffs_inode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_inode.c,v 1.71 2014/07/12 18:44:01 tedu Exp $ */
+/* $OpenBSD: ffs_inode.c,v 1.72 2014/07/13 23:33:26 tedu Exp $ */
/* $NetBSD: ffs_inode.c,v 1.10 1996/05/11 18:27:19 mycroft Exp $ */
/*
@@ -561,7 +561,7 @@ ffs_indirtrunc(struct inode *ip, daddr_t lbn, daddr_t dbn,
}
}
if (copy != NULL) {
- free(copy, M_TEMP, 0);
+ free(copy, M_TEMP, fs->fs_bsize);
} else {
bp->b_flags |= B_INVAL;
brelse(bp);
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 40be455808e..8ad885b89d5 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_vfsops.c,v 1.141 2014/07/12 18:44:01 tedu Exp $ */
+/* $OpenBSD: ffs_vfsops.c,v 1.142 2014/07/13 23:33:26 tedu Exp $ */
/* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */
/*
@@ -139,7 +139,7 @@ ffs_mountroot(void)
if ((error = ffs_mountfs(rootvp, mp, p)) != 0) {
mp->mnt_vfc->vfc_refcount--;
vfs_unbusy(mp);
- free(mp, M_MOUNT, 0);
+ free(mp, M_MOUNT, sizeof(*mp));
vrele(swapdev_vp);
vrele(rootvp);
return (error);
@@ -907,9 +907,9 @@ out:
VOP_UNLOCK(devvp, 0, p);
if (ump) {
- free(ump->um_fs, M_UFSMNT, 0);
- free(ump, M_UFSMNT, 0);
- mp->mnt_data = (qaddr_t)0;
+ free(ump->um_fs, M_UFSMNT, sizeof(*ump->um_fs));
+ free(ump, M_UFSMNT, sizeof(*ump));
+ mp->mnt_data = NULL;
}
return (error);
}
@@ -1027,8 +1027,8 @@ ffs_unmount(struct mount *mp, int mntflags, struct proc *p)
NOCRED, p);
vput(ump->um_devvp);
free(fs->fs_csp, M_UFSMNT, 0);
- free(fs, M_UFSMNT, 0);
- free(ump, M_UFSMNT, 0);
+ free(fs, M_UFSMNT, sizeof(*fs));
+ free(ump, M_UFSMNT, sizeof(*ump));
mp->mnt_data = (qaddr_t)0;
mp->mnt_flag &= ~MNT_LOCAL;
return (error);