From: Kyrylo Tkachov Date: Tue, 10 May 2016 16:15:20 +0000 (+0000) Subject: [ARM] PR driver/70132: Avoid double fclose in driver-arm.c X-Git-Tag: releases/gcc-4.9.4~184 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9d1cc5abfc2d378554d86837a2398bebf2b91fe;p=thirdparty%2Fgcc.git [ARM] PR driver/70132: Avoid double fclose in driver-arm.c Backport from mainline 2016-03-23 Kyrylo Tkachov PR driver/70132 * config/arm/driver-arm.c (host_detect_local_cpu): Reorder exit logic to not call fclose twice on file. From-SVN: r236092 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0673d21d7099..b17c08416482 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2016-05-10 Kyrylo Tkachov + + Backport from mainline + 2016-03-23 Kyrylo Tkachov + + PR driver/70132 + * config/arm/driver-arm.c (host_detect_local_cpu): Reorder exit logic + to not call fclose twice on file. + 2016-05-10 Bill Schmidt Backport from mainline diff --git a/gcc/config/arm/driver-arm.c b/gcc/config/arm/driver-arm.c index 6d9c4174c967..ea5c265ba966 100644 --- a/gcc/config/arm/driver-arm.c +++ b/gcc/config/arm/driver-arm.c @@ -124,12 +124,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: {