From 986d9fc3bbf8a6d9d088ca22d1422bd5de249396 Mon Sep 17 00:00:00 2001 From: George Dunlap Date: Thu, 25 Feb 2016 14:49:03 +0000 Subject: [PATCH] tools/xenalyze: Actually handle case where number of ipi vectors exceeds static max 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 Acked-by: Ian Jackson --- tools/xentrace/xenalyze.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c index d071f9d23c..8913031807 100644 --- a/tools/xentrace/xenalyze.c +++ b/tools/xentrace/xenalyze.c @@ -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; } -- 2.30.2