[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] xen-mfndump: drop dead assignment to "page" from lookup_pte_func()



commit cf584d27f56b9de2f9cd19df35bde0687c8437cc
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Jun 14 12:31:02 2023 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Jun 14 12:31:02 2023 +0200

    xen-mfndump: drop dead assignment to "page" from lookup_pte_func()
    
    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@xxxxxxxx>
    Reviewed-by: Jason Andryuk <jandryuk@xxxxxxxxx>
    Acked-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 tools/misc/xen-mfndump.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/misc/xen-mfndump.c b/tools/misc/xen-mfndump.c
index 8863ece3f5..28687afbf0 100644
--- a/tools/misc/xen-mfndump.c
+++ b/tools/misc/xen-mfndump.c
@@ -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);
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.