Merge "Add else branch to avoide fclose(NULL)" am: 10b043bb13 am: dded161774 am: 903044c667
am: f7e0b5185e

Change-Id: I63549a1b35a0ffb82f90f0cf0ea0fdc5005f4943
diff --git a/modules/thermal/thermal.c b/modules/thermal/thermal.c
index 6ba5845..7f4de3b 100644
--- a/modules/thermal/thermal.c
+++ b/modules/thermal/thermal.c
@@ -138,8 +138,9 @@
             fclose(file);
             fclose(cpu_file);
             return errno ? -errno : -EIO;
+        } else {
+            fclose(cpu_file);
         }
-        fclose(cpu_file);
 
         if (list != NULL) {
             list[size] = (cpu_usage_t) {