[ofa-general] [PATCH] osm: TRIVIAL bug fix

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Mon Jun 11 07:21:37 PDT 2007


Hi Hal,

Fixing a small bug that was "inherited" when moved code that 
reads guid file from osm_ucast_updn.c to osm_ucast_mgr.c - 
closing file descriptor when finished reading the guid file.

-- Yevgeny

Signed-off-by:  Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 opensm/opensm/osm_ucast_mgr.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/opensm/opensm/osm_ucast_mgr.c b/opensm/opensm/osm_ucast_mgr.c
index b080f59..d855683 100644
--- a/opensm/opensm/osm_ucast_mgr.c
+++ b/opensm/opensm/osm_ucast_mgr.c
@@ -1052,7 +1052,7 @@ osm_ucast_mgr_read_guid_file(
   IN  cl_list_t       * p_list )
 {
   cl_status_t   status = IB_SUCCESS;
-  FILE        * guid_file;
+  FILE        * guid_file = NULL;
   char          line[MAX_GUID_FILE_LINE_LENGTH];
   char        * endptr;
   uint64_t    * p_guid;
@@ -1112,6 +1112,8 @@ osm_ucast_mgr_read_guid_file(
   }
 
 Exit :
+  if (guid_file)
+    fclose(guid_file);
   OSM_LOG_EXIT( p_mgr->p_log );
   return (status);
 }
-- 
1.5.1.4




More information about the general mailing list