do_fork(): fix tids memory leak; additional sanity checks

This commit is contained in:
Balazs Gerofi
2016-08-18 14:31:52 +09:00
parent bd6a2c2311
commit 7ebc34ddcc
6 changed files with 23 additions and 5 deletions

View File

@ -87,11 +87,19 @@ void ihk_mc_free_pages(void *p, int npages)
void *ihk_mc_allocate(int size, int flag)
{
if (!cpu_local_var(kmalloc_initialized)) {
kprintf("%s: error, kmalloc not yet initialized\n", __FUNCTION__);
return NULL;
}
return kmalloc(size, IHK_MC_AP_NOWAIT);
}
void ihk_mc_free(void *p)
{
if (!cpu_local_var(kmalloc_initialized)) {
kprintf("%s: error, kmalloc not yet initialized\n", __FUNCTION__);
return;
}
kfree(p);
}