[igt-dev] [PATCH i-g-t 15/21] igt_aux: Handle empty pm_test file gracefully

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

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Imre Deak <imre.deak@intel.com>
---
lib/igt_aux.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index 1250d5c5..e9bf0728 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -718,6 +718,9 @@ static enum igt_suspend_test get_suspend_test(int power_dir)
break;
}

+ if (!test_name)
+ return SUSPEND_TEST_NONE;
+
for (test = SUSPEND_TEST_NONE; test < SUSPEND_TEST_NUM; test++)
if (strcmp(suspend_test_name[test], test_name) == 0)
break;
--
2.19.1