From: Konrad Rzeszutek Wilk Date: Thu, 17 Mar 2016 12:48:24 +0000 (+0100) Subject: vmap: ASSERT on NULL X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~1539 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1e4faa2d25639856f776460e8cbbe2b48843dd20;p=xen.git 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 --- diff --git a/xen/common/vmap.c b/xen/common/vmap.c index c57239ff0a..134eda08d6 100644 --- a/xen/common/vmap.c +++ b/xen/common/vmap.c @@ -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 )