[Intel-gfx] [PATCH] tests/drv_hangman: Fix uninitialized tail usage

Mika Kuoppala mika.kuoppala at linux.intel.com
Fri Oct 30 08:58:33 PDT 2015


Tail needs to be in outer scope as it is used after loop
continuation destroying its scope.

Reported-by: Thomas Wood <thomas.wood at intel.com>
Cc: Thomas Wood <thomas.wood at intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com>
---
 tests/drv_hangman.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/drv_hangman.c b/tests/drv_hangman.c
index 6caf910..280f903 100644
--- a/tests/drv_hangman.c
+++ b/tests/drv_hangman.c
@@ -240,6 +240,7 @@ static void check_error_state(const int gen,
 	size_t line_size = 0;
 	char *ring_name = NULL;
 	bool bb_ok = false, req_ok = false, ringbuf_ok = false;
+	uint32_t tail;
 
 	debug_fd = igt_debugfs_open("i915_error_state", O_RDONLY);
 	igt_assert_lte(0, debug_fd);
@@ -252,7 +253,6 @@ static void check_error_state(const int gen,
 		uint64_t gtt_offset;
 		int req_matched = 0;
 		int requests;
-		uint32_t tail;
 		int ringbuf_matched = 0;
 		int i, items;
 
-- 
2.5.0



More information about the Intel-gfx mailing list