[igt-dev] [PATCH i-g-t 19/21] lib/igt_kms: Aid static analyzer with the control flow

Petri Latvala petri.latvala at intel.com
Wed Jan 16 11:20:48 UTC 2019


If we first find n amount of ':' in a string, the amount is still n
when we walk through it the second time.

Signed-off-by: Petri Latvala <petri.latvala at intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
---
 lib/igt_kmod.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index 22c26021..91662eb3 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -86,6 +86,7 @@ static struct kmod_ctx *kmod_ctx(void)
 
 		p = config_paths_str;
 		for (i = 0; i < count; ++i) {
+			igt_assert(p != NULL);
 			config_paths[i] = p;
 
 			if ((p = strchr(p, ':')))
-- 
2.19.1



More information about the igt-dev mailing list