From: Peter Dinda Date: Mon, 24 Mar 2014 21:59:03 +0000 (-0500) Subject: Ignore frees of null in all cases (kfree, vfree, pagefree) X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=35ae6d4aed98585da4c63817a4336daa10546e40 Ignore frees of null in all cases (kfree, vfree, pagefree) --- diff --git a/linux_module/palacios-stubs.c b/linux_module/palacios-stubs.c index 694a212..965d578 100644 --- a/linux_module/palacios-stubs.c +++ b/linux_module/palacios-stubs.c @@ -211,6 +211,7 @@ void palacios_free_pages(void * page_paddr, int num_pages) { if (!page_paddr) { ERROR("Ignoring free pages: 0x%p (0x%lx)for %d pages\n", page_paddr, (uintptr_t)page_paddr, num_pages); dump_stack(); + return; } pg_frees += num_pages; free_palacios_pgs((uintptr_t)page_paddr, num_pages); @@ -283,6 +284,11 @@ palacios_valloc(unsigned int size) void palacios_vfree(void *p) { + if (!p) { + ERROR("Ignoring vfree: 0x%p\n",p); + dump_stack(); + return; + } vfree(p); vfrees++; MEMCHECK_VFREE(p); @@ -318,6 +324,7 @@ palacios_free( if (!addr) { ERROR("Ignoring free : 0x%p\n", addr); dump_stack(); + return; } frees++; kfree(addr-ALLOC_PAD);