]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
xen/arm: initialize access
authorStefano Stabellini <sstabellini@kernel.org>
Tue, 6 Nov 2018 22:05:57 +0000 (14:05 -0800)
committerJulien Grall <julien.grall@arm.com>
Fri, 9 Nov 2018 11:49:40 +0000 (11:49 +0000)
Initialize variable *access before returning it back to the caller.
It makes the code a bit nicer and it is a safety certification
requirement.

M3CM Rule-9.1: The value of an object with automatic storage duration
shall not be read before it has been set

QAVerify: 2962
Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>
Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Acked-by: Julien Grall <julien.grall@arm.com>
CC: rcojocaru@bitdefender.com
CC: Tamas K Lengyel <tamas@tklengyel.com>
xen/arch/arm/mem_access.c

index 653d96050d57e64e8922c81aa90dfc35b6627d16..86ddb29c55c83cd708407af3ec668f126cc2c021 100644 (file)
@@ -47,6 +47,7 @@ static int __p2m_get_mem_access(struct domain *d, gfn_t gfn,
     };
 
     ASSERT(p2m_is_locked(p2m));
+    *access = p2m->default_access;
 
     /* If no setting was ever set, just return rwx. */
     if ( !p2m->mem_access_enabled )