kernel: dont use smalloc() to allocate pte array in ibrk()
when we'r out of kernel memory, it is probably better to let that alloc fail instead of hanging while holding the segment qlock.
This commit is contained in:
parent
27fb90eb6e
commit
d6eb7cc71c
1 changed files with 5 additions and 1 deletions
|
@ -437,7 +437,11 @@ ibrk(uintptr addr, int seg)
|
|||
}
|
||||
mapsize = ROUND(newsize, PTEPERTAB)/PTEPERTAB;
|
||||
if(mapsize > s->mapsize){
|
||||
map = smalloc(mapsize*sizeof(Pte*));
|
||||
map = malloc(mapsize*sizeof(Pte*));
|
||||
if(map == nil){
|
||||
qunlock(s);
|
||||
error(Enomem);
|
||||
}
|
||||
memmove(map, s->map, s->mapsize*sizeof(Pte*));
|
||||
if(s->map != s->ssegmap)
|
||||
free(s->map);
|
||||
|
|
Loading…
Reference in a new issue