Mesa (staging/19.1): intel/dump: fix segfault when the app hasn't accessed the device

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 18 10:05:52 UTC 2019


Module: Mesa
Branch: staging/19.1
Commit: 0f8193cb18d3d8557dd934cc2d169fe6a63321e7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0f8193cb18d3d8557dd934cc2d169fe6a63321e7

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Sat Apr 27 09:36:23 2019 +0800

intel/dump: fix segfault when the app hasn't accessed the device

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
(cherry picked from commit f80679c8e8aa3f1ff17deef7163ad9429eb90f44)

---

 src/intel/tools/intel_dump_gpu.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/intel/tools/intel_dump_gpu.c b/src/intel/tools/intel_dump_gpu.c
index 23112cadc36..74a892c358d 100644
--- a/src/intel/tools/intel_dump_gpu.c
+++ b/src/intel/tools/intel_dump_gpu.c
@@ -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);
+   }
 }




More information about the mesa-commit mailing list