]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
xen-mfndump: drop dead assignment to "page" from lookup_pte_func()
authorJan Beulich <jbeulich@suse.com>
Wed, 14 Jun 2023 10:31:02 +0000 (12:31 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 14 Jun 2023 10:31:02 +0000 (12:31 +0200)
The variable isn't used past the loop, and its value also isn't
meaningful across iterations. Reduce its scope to make this more
obvious.

Coverity ID: 1532310
Fixes: ae763e422430 ("tools/misc: introduce xen-mfndump")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
tools/misc/xen-mfndump.c

index 8863ece3f5913cd3c4c2ce436dc171ec2717b511..28687afbf01aed51302960a0e0f3f6449f58439e 100644 (file)
@@ -265,7 +265,6 @@ int lookup_pte_func(int argc, char *argv[])
 {
     struct xc_domain_meminfo minfo;
     xc_domaininfo_t info;
-    void *page = NULL;
     unsigned long i, j;
     int domid, pte_num;
     xen_pfn_t mfn;
@@ -301,6 +300,8 @@ int lookup_pte_func(int argc, char *argv[])
 
     for ( i = 0; i < minfo.p2m_size; i++ )
     {
+        void *page;
+
         if ( !(minfo.pfn_type[i] & XEN_DOMCTL_PFINFO_LTABTYPE_MASK) )
             continue;
 
@@ -323,7 +324,6 @@ int lookup_pte_func(int argc, char *argv[])
         }
 
         munmap(page, XC_PAGE_SIZE);
-        page = NULL;
     }
 
     xc_unmap_domain_meminfo(xch, &minfo);