intel/compiler: Fix resource leak in error path
authorDanylo Piliaiev <danylo.piliaiev@globallogic.com>
Tue, 13 Aug 2019 08:25:03 +0000 (11:25 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Thu, 15 Aug 2019 08:17:36 +0000 (08:17 +0000)
CID: 1452261

Fixes: 04a99515 "intel/compiler: add ability to override shader's assembly"
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/intel/compiler/brw_eu.c

index 882293e981bcc751a94233689c22b514f1196963..db08999c7ee759bac29ab4df6f0dc01d41a4133b 100644 (file)
@@ -370,6 +370,7 @@ bool brw_try_override_assembly(struct brw_codegen *p, int start_offset,
 
    struct stat sb;
    if (fstat(fd, &sb) != 0 || (!S_ISREG(sb.st_mode))) {
+      close(fd);
       return false;
    }