From c84502b6845153e6b7a391d5b5acc87592db8ecf Mon Sep 17 00:00:00 2001 From: Petri Latvala Date: Wed, 16 Jan 2019 13:20:44 +0200 Subject: igt_aux: Handle empty pm_test file gracefully Signed-off-by: Petri Latvala Cc: Imre Deak Reviewed-by: Arkadiusz Hiler --- lib/igt_aux.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/igt_aux.c') diff --git a/lib/igt_aux.c b/lib/igt_aux.c index 2e2d552b..ff98d91d 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; -- cgit v1.2.3