intel: aubinator_error_decode: fix segfault on missing register
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 22 Feb 2018 13:41:10 +0000 (13:41 +0000)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 26 Feb 2018 16:54:48 +0000 (16:54 +0000)
Some register might be missing in our genxmls. Don't try to decode
them.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/tools/aubinator_error_decode.c

index 2331114b446789eacbd9f8de6de6a084057c6a9d..017be5bbc2b0379478caf7b801d85efceb7e666a 100644 (file)
@@ -65,7 +65,8 @@ print_head(unsigned int reg)
 static void
 print_register(struct gen_spec *spec, const char *name, uint32_t reg)
 {
-   struct gen_group *reg_spec = gen_spec_find_register_by_name(spec, name);
+   struct gen_group *reg_spec =
+      name ? gen_spec_find_register_by_name(spec, name) : NULL;
 
    if (reg_spec) {
       gen_print_group(stdout, reg_spec, 0, &reg, 0,