intel/dump: fix segfault when the app hasn't accessed the device
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Sat, 27 Apr 2019 01:36:23 +0000 (09:36 +0800)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 12 Jun 2019 06:49:55 +0000 (09:49 +0300)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/tools/intel_dump_gpu.c

index d378375951e24b0143cc5c03c694df322406f93b..09b8db39aa29582288dd955389c592d7348e6e49 100644 (file)
@@ -567,7 +567,9 @@ ioctl_init_helper(int fd, unsigned long request, ...)
 static void __attribute__ ((destructor))
 fini(void)
 {
-   free(output_filename);
-   aub_file_finish(&aub_file);
-   free(bos);
+   if (devinfo.gen != 0) {
+      free(output_filename);
+      aub_file_finish(&aub_file);
+      free(bos);
+   }
 }