summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-10-12 20:05:58 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-10-12 20:05:58 +0100
commit836f8812f0e6c44674c1c75501640eabbdd8918a (patch)
treef41f9eefd1fb6c1627484c3747265e546e0010e5
parent9375266293446922b02c6137360e82b72c7c6495 (diff)
lib: Initialise 'wedged' in case of debugfs fail
If the debugfs dir cannot be found, the read/write of wedged status will fail and leave the local variable unset. Give it a value to ensure a consistent result. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
-rw-r--r--lib/igt_gt.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index 3e5eb47db..8213526fc 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -368,6 +368,7 @@ void igt_force_gpu_reset(int drm_fd)
dir = igt_debugfs_dir(drm_fd);
+ wedged = 0;
igt_sysfs_set(dir, "i915_wedged", "-1");
igt_sysfs_scanf(dir, "i915_wedged", "%d", &wedged);