]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
tests/resource: Initialise gnttab before xenforeignmemory_map_resource()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Sat, 19 Feb 2022 16:59:01 +0000 (16:59 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 21 Feb 2022 18:17:56 +0000 (18:17 +0000)
It's the 'addr' input to mmap(), and currently consuming stack rubble.

Coverity-ID: 1500115
Fixes: c7a7f14b9299 ("tests/resource: Extend to check that the grant frames are mapped correctly")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
tools/tests/resource/test-resource.c

index 0557f8a1b585ba5921535666ae477a140b5af68d..189353ebcb436ee0577cb313ff7cb9d72de48efd 100644 (file)
@@ -24,7 +24,7 @@ static void test_gnttab(uint32_t domid, unsigned int nr_frames,
                         unsigned long gfn)
 {
     xenforeignmemory_resource_handle *res;
-    grant_entry_v1_t *gnttab;
+    grant_entry_v1_t *gnttab = NULL;
     size_t size;
     int rc;
     uint32_t refs[nr_frames], domids[nr_frames];