[igt-dev] [PATCH i-g-t 4/4] tests/i915/gem_eio: Fix use after free

Ryszard Knop ryszard.knop at intel.com
Thu Jun 2 08:22:24 UTC 2022


ctx is freed right before that line, use dir instead.

Signed-off-by: Ryszard Knop <ryszard.knop at intel.com>
---
 tests/i915/gem_eio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/i915/gem_eio.c b/tests/i915/gem_eio.c
index 913a21f9..135217e2 100644
--- a/tests/i915/gem_eio.c
+++ b/tests/i915/gem_eio.c
@@ -273,7 +273,7 @@ static void hang_handler(union sigval arg)
 	free(ctx);
 
 	/* flush any excess work before we start timing our reset */
-	igt_assert(igt_sysfs_printf(ctx->debugfs, "i915_drop_caches",
+	igt_assert(igt_sysfs_printf(dir, "i915_drop_caches",
 				    "%d", DROP_RCU));
 
 	igt_nsec_elapsed(ts);
-- 
2.36.1



More information about the igt-dev mailing list