This avoids a resource leak and needless playing with the pagetables in the
case that the page is broken.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <JBeulich@suse.com>
Reviewed-by: Keir Fraser <keir@xen.org>
void scrub_one_page(struct page_info *pg)
{
- void *p = __map_domain_page(pg);
+ void *p;
if ( unlikely(pg->count_info & PGC_broken) )
return;
+ p = __map_domain_page(pg);
+
#ifndef NDEBUG
/* Avoid callers relying on allocations returning zeroed pages. */
memset(p, 0xc2, PAGE_SIZE);