public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tools/intel_reg: Fix segfault in intel_reg dump
@ 2018-02-02 10:34 Mika Kuoppala
  2018-02-02 11:07 ` Jani Nikula
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Mika Kuoppala @ 2018-02-02 10:34 UTC (permalink / raw)
  To: intel-gfx; +Cc: Jani Nikula

We need to zero out the builtin reg spec we are parsing into.
Otherwise engine will be uninitialized and we segfault when trying
to find engine and accessing reg->engine in later stage.

Fixes: 7f0be0e7d9be ("tools/intel_reg: Add reading and writing registers through engine")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104895
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Marta Löfstedt <marta.lofstedt@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 tools/intel_reg_decode.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/intel_reg_decode.c b/tools/intel_reg_decode.c
index 46b19676..b351dcb5 100644
--- a/tools/intel_reg_decode.c
+++ b/tools/intel_reg_decode.c
@@ -2748,6 +2748,8 @@ static ssize_t get_regs(struct reg **regs, size_t *nregs, ssize_t index,
 				&known_registers[i].regs[j];
 			struct reg reg;
 
+			memset(&reg, 0, sizeof(reg));
+
 			/* XXX: Could be optimized. */
 			parse_port_desc(&reg, NULL);
 
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-02-02 16:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-02 10:34 [PATCH i-g-t] tools/intel_reg: Fix segfault in intel_reg dump Mika Kuoppala
2018-02-02 11:07 ` Jani Nikula
2018-02-02 11:28 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-02-02 13:04 ` ✓ Fi.CI.IGT: " Patchwork
2018-02-02 13:19 ` [PATCH i-g-t] " Mika Kuoppala
2018-02-02 13:22   ` Mika Kuoppala
2018-02-02 14:35 ` ✓ Fi.CI.BAT: success for tools/intel_reg: Fix segfault in intel_reg dump (rev2) Patchwork
2018-02-02 16:46 ` ✗ Fi.CI.IGT: warning " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox