[ARM] PR driver/70132: Avoid double fclose in driver-arm.c
authorktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Mar 2016 10:16:31 +0000 (10:16 +0000)
committerktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Mar 2016 10:16:31 +0000 (10:16 +0000)
PR driver/70132
* config/arm/driver-arm.c (host_detect_local_cpu): Reorder exit logic
to not call fclose twice on file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234419 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/arm/driver-arm.c

index 9a1eb03..f78ff93 100644 (file)
@@ -1,3 +1,9 @@
+2016-03-23  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       PR driver/70132
+       * config/arm/driver-arm.c (host_detect_local_cpu): Reorder exit logic
+       to not call fclose twice on file.
+
 2016-03-23  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/70354
index 466743b..95dc9d5 100644 (file)
@@ -128,12 +128,11 @@ host_detect_local_cpu (int argc, const char **argv)
        }
     }
 
-  fclose (f);
-
-  if (val == NULL)
-    goto not_found;
-
-  return concat ("-m", argv[0], "=", val, NULL);
+  if (val)
+    {
+      fclose (f);
+      return concat ("-m", argv[0], "=", val, NULL);
+     }
 
 not_found:
   {