From patchwork Tue May 22 09:03:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 160576 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 5D7EDB6FA2 for ; Tue, 22 May 2012 19:32:31 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SWlSA-00086v-9E for incoming@patchwork.ozlabs.org; Tue, 22 May 2012 09:32:30 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SWkzz-0007El-Tl for fwts-devel@lists.ubuntu.com; Tue, 22 May 2012 09:03:23 +0000 Received: from [210.242.151.101] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SWkzz-0000se-AU; Tue, 22 May 2012 09:03:23 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH] lib: fwts_battery: fix no fclose() after fopen is called. Date: Tue, 22 May 2012 17:03:19 +0800 Message-Id: <1337677399-18844-1-git-send-email-alex.hung@canonical.com> X-Mailer: git-send-email 1.7.9.5 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com Signed-off-by: Alex Hung Acked-by: Keng-Yu Lin --- src/lib/src/fwts_battery.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/src/fwts_battery.c b/src/lib/src/fwts_battery.c index d8cc318..5f21dfa 100644 --- a/src/lib/src/fwts_battery.c +++ b/src/lib/src/fwts_battery.c @@ -101,6 +101,7 @@ static int fwts_battery_get_capacity_sys_fs(fwts_framework *fw, (*count)++; } } + fclose(fp); } } } while (entry); @@ -167,6 +168,7 @@ static int fwts_battery_get_capacity_proc_fs(fwts_framework *fw, break; } } + fclose(fp); } } } while (entry); @@ -307,6 +309,7 @@ static int fwts_battery_get_cycle_count_sys_fs(fwts_framework *fw, DIR *dir, int *cycle_count = val; } } + fclose(fp); } } } while (entry); @@ -350,6 +353,7 @@ static int fwts_battery_get_cycle_count_proc_fs(fwts_framework *fw, DIR *dir, in break; } } + fclose(fp); } } } while (entry);