slab: log bad kfree
This commit is contained in:
parent
ea1c1b337d
commit
b84a48aaa7
1 changed files with 3 additions and 1 deletions
|
|
@ -205,8 +205,10 @@ void kfree(void *ptr)
|
|||
return;
|
||||
|
||||
struct rbnode *n = rbt_search(&kmalloc_tree, (uint64_t)ptr);
|
||||
if (n == NULL)
|
||||
if (n == NULL) {
|
||||
printf(LOG_ERROR "kmalloc: invalid free: %p\n", ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
struct slab *slab = (struct slab *)n->value;
|
||||
if (slab != NULL)
|
||||
|
|
|
|||
Loading…
Reference in a new issue