vmap: ASSERT on NULL

The vmap_to_page macro (three levels deep!) can come up with
a NULL pointer. Lets add the proper ASSERT to catch this errant
behavior.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
This commit is contained in:
Konrad Rzeszutek Wilk authored and Jan Beulich committed 2016-03-17 13:48:24 +01:00
1 parent eb6fe7a469
commit 1e4faa2d25
1 file changed
+5 -1
+5 -1
View File
@@ -279,8 +279,12 @@ void vfree(void *va)
ASSERT(pages);
for ( i = 0; i < pages; i++ )
page_list_add(vmap_to_page(va + i * PAGE_SIZE), &pg_list);
{
struct page_info *page = vmap_to_page(va + i * PAGE_SIZE);
ASSERT(page);
page_list_add(page, &pg_list);
}
vunmap(va);
while ( (pg = page_list_remove_head(&pg_list)) != NULL )
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.