xen/vmap: Avoid hitting an ASSERT with vfree(NULL)
PATCH 1/1 xen/vmap: Avoid hitting an ASSERT with vfree(NULL)
and unconditionally defer the vm_size() call, as it doesn't have a NULL short circuit.
Reported-by Wei Liu <[email protected]>
Signed-off-by Andrew Cooper <[email protected]>
Tested-by Wei Liu <[email protected]>
Reviewed-by Roger Pau Monné <[email protected]>
CC Keir Fraser <[email protected]>
CC Jan Beulich <[email protected]>
CC Tim Deegan <[email protected]>
--- xen/common/vmap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
xen/common/vmap.c +5 -1
@@ -268,10 +268,14 @@ void *vzalloc(size_t size)void vfree (void *va) { -unsigned int i, pages =vm_size (va); +unsigned int i, pages;struct page_info *pg;PAGE_LIST_HEAD (pg_list); +if ( !va ) +return ; + + pages =vm_size (va);ASSERT (pages);for ( i =0 ; i < pages; i++ )
Signature · 7 lines
1.7.10.4 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Quoted 9 lines · Andrew Cooper
and unconditionally defer the
vm_size()call, as it doesn't have a NULL short circuit.Reported-by Wei Liu <[email protected]>Signed-off-by Andrew Cooper <[email protected]>Tested-by Wei Liu <[email protected]>Reviewed-by Roger Pau Monné <[email protected]>CC Keir Fraser <[email protected]>CC Jan Beulich <[email protected]>CC Tim Deegan <[email protected]>
Acked-by Tim Deegan <[email protected]>