lkml.org 
[lkml]   [2012]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[ 22/52] tools/hv: Fix file handle leak
Date
3.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ben Hutchings <ben@decadent.org.uk>

commit d5ab482799e7c4c4b7c0aa67e8710dce28115d03 upstream.

Match up each fopen() with an fclose().

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
tools/hv/hv_kvp_daemon.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -144,7 +144,7 @@ static void kvp_update_file(int pool)
sizeof(struct kvp_record),
kvp_file_info[pool].num_records, filep);

- fflush(filep);
+ fclose(filep);
kvp_release_lock(pool);
}

@@ -191,6 +191,7 @@ static void kvp_update_mem_state(int poo
kvp_file_info[pool].records = record;
kvp_file_info[pool].num_records = records_read;

+ fclose(filep);
kvp_release_lock(pool);
}
static int kvp_file_init(void)



\
 
 \ /
  Last update: 2012-10-05 04:41    [W:0.196 / U:2.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site