1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

Fix _zget() so that it checks the return from kmem_alloc(), to avoid

zttempting to bzero NULL when the kernel map fills up.  _zget() will
now return NULL as it seems it was originally intended to do.
This commit is contained in:
Mike Smith 2000-04-04 21:00:39 +00:00
parent 8d9f1945b9
commit e36bc62387
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=59017

View File

@ -334,7 +334,8 @@ _zget(vm_zone_t z)
#ifdef SMP
simple_lock(&z->zlock);
#endif
zone_kmem_pages += z->zalloc;
if (item != NULL)
zone_kmem_pages += z->zalloc;
splx(s);
} else {
#ifdef SMP
@ -344,9 +345,14 @@ _zget(vm_zone_t z)
#ifdef SMP
simple_lock(&z->zlock);
#endif
zone_kern_pages += z->zalloc;
if (item != NULL)
zone_kern_pages += z->zalloc;
}
if (item != NULL) {
bzero(item, nbytes);
} else {
nbytes = 0;
}
bzero(item, nbytes);
nitems = nbytes / z->zsize;
}
z->ztotal += nitems;