aboutsummaryrefslogtreecommitdiffstats
path: root/xen
diff options
context:
space:
mode:
authorAndrew Cooper <andrew.cooper3@citrix.com>2013-09-09 18:43:40 +0100
committerTim Deegan <tim@xen.org>2013-09-10 15:46:35 +0100
commitac2f555e37f589fde27c68a306aaac14a424040b (patch)
tree67a632e5cfc3dc8743fbe0dacbfe4c6af3d69881 /xen
parentf3a4eb9253826d1e49e682314c8666b28fa0b717 (diff)
downloadxen-ac2f555e37f589fde27c68a306aaac14a424040b.tar.gz
xen-ac2f555e37f589fde27c68a306aaac14a424040b.tar.bz2
xen-ac2f555e37f589fde27c68a306aaac14a424040b.zip
x86/mm: Fix possible increment of uninitialised variable
Discovered by Coverity, CID 1056101 When taking the continue branch on the first iteration of the loop, gfn would indeed be uninitialised when incremented. However, as gfn is unconditionally constructed from i{1..4} before use in the loop body, having it incremented in the loop header is useless. Therefore, simply remove it. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Acked-by: Tim Deegan <tim@xen.org>
Diffstat (limited to 'xen')
-rw-r--r--xen/arch/x86/mm/p2m-pt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 302b621199..a1d565068d 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -691,7 +691,7 @@ static void p2m_change_type_global(struct p2m_domain *p2m,
l1mfn = _mfn(l2e_get_pfn(l2e[i2]));
l1e = map_domain_page(mfn_x(l1mfn));
- for ( i1 = 0; i1 < L1_PAGETABLE_ENTRIES; i1++, gfn++ )
+ for ( i1 = 0; i1 < L1_PAGETABLE_ENTRIES; i1++ )
{
flags = l1e_get_flags(l1e[i1]);
if ( p2m_flags_to_type(flags) != ot )