summaryrefslogtreecommitdiff
path: root/lib/igt_aux.c
diff options
context:
space:
mode:
authorPetri Latvala <petri.latvala@intel.com>2019-01-16 13:20:44 +0200
committerPetri Latvala <petri.latvala@intel.com>2019-01-28 15:40:28 +0200
commitc84502b6845153e6b7a391d5b5acc87592db8ecf (patch)
tree06c6c2cf9be24eb42aa2165d0a5fb9e9d3d5cc1b /lib/igt_aux.c
parent1923867616cc57d9637597500106c8eef48ea8e7 (diff)
igt_aux: Handle empty pm_test file gracefully
Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Imre Deak <imre.deak@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'lib/igt_aux.c')
-rw-r--r--lib/igt_aux.c3
1 files changed, 3 insertions, 0 deletions
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;