mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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:
1 parent
eb6fe7a469
commit
1e4faa2d25
1 file changed
+5
-1
+5
-1
@@ -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 )
|
||||
|
||||