summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/msdosfs/msdosfs_vfsops.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c
index b08da5cd167..f164a4b5156 100644
--- a/sys/msdosfs/msdosfs_vfsops.c
+++ b/sys/msdosfs/msdosfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msdosfs_vfsops.c,v 1.40 2006/08/22 19:30:48 sturm Exp $ */
+/* $OpenBSD: msdosfs_vfsops.c,v 1.41 2006/11/26 00:59:32 pedro Exp $ */
/* $NetBSD: msdosfs_vfsops.c,v 1.48 1997/10/18 02:54:57 briggs Exp $ */
/*-
@@ -542,7 +542,11 @@ msdosfs_mountfs(devvp, mp, p, argp)
pmp->pm_inusemap = malloc(((pmp->pm_maxcluster + N_INUSEBITS - 1)
/ N_INUSEBITS)
* sizeof(*pmp->pm_inusemap),
- M_MSDOSFSFAT, M_WAITOK);
+ M_MSDOSFSFAT, M_WAITOK | M_CANFAIL);
+ if (pmp->pm_inusemap == NULL) {
+ error = EINVAL;
+ goto error_exit;
+ }
/*
* fillinusemap() needs pm_devvp.