From: Lionel Landwerlin Date: Sat, 27 Apr 2019 01:36:23 +0000 (+0800) Subject: intel/dump: fix segfault when the app hasn't accessed the device X-Git-Tag: upstream/19.3.0~5580 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f80679c8e8aa3f1ff17deef7163ad9429eb90f44;p=platform%2Fupstream%2Fmesa.git intel/dump: fix segfault when the app hasn't accessed the device Signed-off-by: Lionel Landwerlin Reviewed-by: Kenneth Graunke --- diff --git a/src/intel/tools/intel_dump_gpu.c b/src/intel/tools/intel_dump_gpu.c index d378375..09b8db3 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); + } }