[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xen-cvs
Subject:    [Xen-changelog] [xen master] vmap: ASSERT on NULL
From:       patchbot () xen ! org
Date:       2016-03-18 10:44:53
Message-ID: E1agrtl-0002q5-90 () xenbits ! xenproject ! org
[Download RAW message or body]

commit 1e4faa2d25639856f776460e8cbbe2b48843dd20
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Thu Mar 17 13:48:24 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Mar 17 13:48:24 2016 +0100

    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>
---
 xen/common/vmap.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/common/vmap.c b/xen/common/vmap.c
index c57239f..134eda0 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 )
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic