lib/xe/xe_gt: Repair xe_gt_stats_get_count function
Resolve the following issues: - The target directory for the fopen does not take into consideration the dri subdirectory and assumes the correct path is dri/0. This might not be the case. Use the "minor" function and fstat to generate the correct subdirectory. - The fopen may fail and return a NULL pointer, causing the subsequent fgets to generate a SIGSEGV. Assert the file opened correctly. - The file opened by fopen is never closed. Close it. v2: fclose (Kamil) Fixes: 10cefd82 ("tests/intel/xe_tlb: Add test to check TLB invalidation") Closes: drm/xe/kernel#3212 Signed-off-by:Jonathan Cavitt <jonathan.cavitt@intel.com> Suggested-by:
Kamil Konieczny <kamil.konieczny@linux.intel.com> CC: Sai Gowtham Ch <sai.gowtham.ch@intel.com> Reviewed-by:
Kamil Konieczny <kamil.konieczny@linux.intel.com>
Loading
Please register or sign in to comment