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

[xen staging] tests/resource: Initialise gnttab before xenforeignmemory_map_resource()



commit 39bcecb9a8fe25d3a1e372187d6358f25ffb06bb
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Sat Feb 19 16:59:01 2022 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Mon Feb 21 18:17:56 2022 +0000

    tests/resource: Initialise gnttab before xenforeignmemory_map_resource()
    
    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@xxxxxxxxxx>
    Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 tools/tests/resource/test-resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tests/resource/test-resource.c 
b/tools/tests/resource/test-resource.c
index 0557f8a1b5..189353ebcb 100644
--- a/tools/tests/resource/test-resource.c
+++ b/tools/tests/resource/test-resource.c
@@ -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];
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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