tools/power x86_energy_perf_policy: close /proc/stat in for_every_cpu()
authorColin Ian King <colin.king@canonical.com>
Thu, 15 Nov 2012 19:02:00 +0000 (14:02 -0500)
committerLen Brown <len.brown@intel.com>
Fri, 30 Nov 2012 06:09:44 +0000 (01:09 -0500)
Instead of returning out of for_every_cpu() we should break out of the loop=
 which will then tidy up correctly by closing the file /proc/stat.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Len Brown <len.brown@intel.com>
tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c

index 33c5c7ee148f27b7c1a0b61c4b256aae6122d637..40b3e5482f8ab745efdd39c58e5a6238ab6fc31b 100644 (file)
@@ -289,7 +289,7 @@ void for_every_cpu(void (func)(int))
                        "cpu%u %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d\n",
                        &cpu);
                if (retval != 1)
-                       return;
+                       break;
 
                func(cpu);
        }