tools/xen-mfndump: Avoid using -ERROR as an upper loop bound

Coverity ID: 1090375

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
Andrew Cooper authored and Ian Jackson committed 2013-11-25 12:16:11 +00:00
1 parent 4fa0ddeef7
commit f55f10a27c
1 file changed
+8 -1
+8 -1
View File
@@ -30,7 +30,8 @@ int help_func(int argc, char *argv[])
int dump_m2p_func(int argc, char *argv[])
{
unsigned long i, max_mfn;
unsigned long i;
long max_mfn;
xen_pfn_t *m2p_table;
if ( argc > 0 )
@@ -41,6 +42,12 @@ int dump_m2p_func(int argc, char *argv[])
/* Map M2P and obtain gpfn */
max_mfn = xc_maximum_ram_page(xch);
if ( max_mfn < 0 )
{
ERROR("Failed to get the maximum mfn");
return -1;
}
if ( !(m2p_table = xc_map_m2p(xch, max_mfn, PROT_READ, NULL)) )
{
ERROR("Failed to map live M2P table");
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.