]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
tools/xenalyze: Actually handle case where number of ipi vectors exceeds static max
authorGeorge Dunlap <george.dunlap@eu.citrix.com>
Thu, 25 Feb 2016 14:49:03 +0000 (14:49 +0000)
committerWei Liu <wei.liu2@citrix.com>
Tue, 15 Mar 2016 16:32:32 +0000 (16:32 +0000)
find_vec() is supposed to find the vector in the list if it exists,
choose an empty slot if it doesn't exist, and return null if all slots
are full.

However, coverity noticed that although the callers of find_vec() handle
the last condition, find_vec() itself didn't.

Check to see if we actually found an empty slot before attempting to
initialize it.

CID 1306864

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/xentrace/xenalyze.c

index d071f9d23cda3c6a1a6d761130cef6add13e80d4..89130318078e79e547c6ebcb6179146ffc8e45d2 100644 (file)
@@ -3547,7 +3547,7 @@ struct outstanding_ipi *find_vec(struct vlapic_struct *vla, int vec)
             o = vla->outstanding.list + i;
     }
 
-    if(!o->valid) {
+    if(o && !o->valid) {
         o->vec = vec;
         o->valid = 1;
     }