Allocate the toplevel indir with M_WAITOK to avoid complicating things

needlessly.

Detected by:	rwatsons EvilMalloc(9)
This commit is contained in:
phk 2003-03-27 10:14:36 +00:00
parent a90fb3254b
commit 8db28f0543

View File

@ -240,9 +240,13 @@ dimension(off_t size)
/*
* XXX: the top layer is probably not fully populated, so we allocate
* too much space for ip->array in new_indir() here.
* too much space for ip->array in here.
*/
ip = new_indir(layer * nshift);
ip = malloc(sizeof *ip, M_MD, M_WAITOK | M_ZERO);
ip->array = malloc(sizeof(uintptr_t) * NINDIR,
M_MDSECT, M_WAITOK | M_ZERO);
ip->total = NINDIR;
ip->shift = layer * nshift;
return (ip);
}