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

[Xen-devel] [PATCH] x86/mm: Initialize ol1e in create_grant_pv_mapping() for older compilers



On gcc 4.4.4:

mm.c: In function ‘create_grant_pv_mapping’:
mm.c:3839: error: ‘ol1e.l1’ may be used uninitialized in this function

While ol1e would not be used uninitialized (because rc needs to be properly
set) we have to accommodate these older compliers.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
---
 xen/arch/x86/mm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 5208e73..8fed981 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3836,7 +3836,8 @@ int create_grant_pv_mapping(uint64_t addr, unsigned long 
frame,
 {
     struct vcpu *curr = current;
     struct domain *currd = curr->domain;
-    l1_pgentry_t nl1e, ol1e, *pl1e;
+    l1_pgentry_t nl1e, *pl1e;
+    l1_pgentry_t ol1e = {0}; /* older compilers may reqiure initialization */
     struct page_info *page;
     mfn_t gl1mfn;
     int rc = GNTST_general_error;
-- 
1.8.3.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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