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

Petri Latvala
2019-01-16T11:21:03Z

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@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@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