ibqueryerrors: Resource leak in path_record_query
PATCH 2/2 ibqueryerrors: Resource leak in path_record_query
From: Vladimir Koushnir <vladimirk-VPRAkNaXOzVWk0Htik3J/[email protected]>
Date: Thu Apr 16 16:39:43 2015 +0300
sa_free_handle function is not called at the end of path_record_query function.
The patch fixes file descriptor leak when path_record_query function is called.
--- src/ibqueryerrors.c | 34 +++++++++++++++++++++++++++------- 1 files changed, 27 insertions(+), 7 deletions(-)
src/ibqueryerrors.c +2 -0
@@ -344,6 +344,7 @@ static int path_record_query(ib_gid_t sgid,uint64_t dguid) (uint16_t )IB_SA_ATTR_PATHRECORD ,0 ,cl_ntoh64 (comp_mask),ibd_sakey, &pr, sizeof(pr), &result);if (ret) { +sa_free_handle (h);fprintf (stderr,"Query SA failed: %s; sa call path_query failed\n" ,strerror (ret));return ret; }
@@ -355,6 +356,7 @@ static int path_record_query(ib_gid_t sgid,uint64_t dguid)insert_lid2sl_table (&result); Exit: +sa_free_handle (h);sa_free_result_mad (&result);return ret; }
Signature · 6 lines
1.7.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 55363F50.3050905-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org
Quoted 10 lines · Hal Rosenstock
From: Vladimir Koushnir <vladimirk-VPRAkNaXOzVWk0Htik3J/[email protected]>
Date: Thu Apr 16 16:39:43 2015 +0300
sa_free_handlefunction is not called at the end ofpath_record_queryfunction.
The patch fixes file descriptor leak whenpath_record_queryfunction is called.
Applied Thanks,
Ira
Quoted 28 lines
--- src/ibqueryerrors.c | 34 +++++++++++++++++++++++++++------- 1 files changed, 27 insertions(+), 7 deletions(-)src/ibqueryerrors.c +2
-0@@ -344,6 +344,7 @@ static int path_record_query(ib_gid_t sgid,uint64_t dguid) (uint16_t )IB_SA_ATTR_PATHRECORD ,0 ,cl_ntoh64 (comp_mask),ibd_sakey, &pr, sizeof(pr), &result);if (ret) { +sa_free_handle (h);fprintf (stderr,"Query SA failed: %s; sa call path_query failed\n" ,strerror (ret));return ret; }@@ -355,6 +356,7 @@ static int path_record_query(ib_gid_t sgid,uint64_t dguid)insert_lid2sl_table (&result); Exit: +sa_free_handle (h);sa_free_result_mad (&result);return ret; }Signature · 1 line
1.7.8.2
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 10 lines · Hal Rosenstock
From: Vladimir Koushnir <vladimirk-VPRAkNaXOzVWk0Htik3J/[email protected]>
Date: Thu Apr 16 16:39:43 2015 +0300
sa_free_handlefunction is not called at the end ofpath_record_queryfunction.
The patch fixes file descriptor leak whenpath_record_queryfunction is called.
Applied Thanks,
Ira
Quoted 27 lines
--- src/ibqueryerrors.c | 34 +++++++++++++++++++++++++++------- 1 files changed, 27 insertions(+), 7 deletions(-)src/ibqueryerrors.c +2
-0@@ -344,6 +344,7 @@ static int path_record_query(ib_gid_t sgid,uint64_t dguid) (uint16_t )IB_SA_ATTR_PATHRECORD ,0 ,cl_ntoh64 (comp_mask),ibd_sakey, &pr, sizeof(pr), &result);if (ret) { +sa_free_handle (h);fprintf (stderr,"Query SA failed: %s; sa call path_query failed\n" ,strerror (ret));return ret; }@@ -355,6 +356,7 @@ static int path_record_query(ib_gid_t sgid,uint64_t dguid)insert_lid2sl_table (&result); Exit: +sa_free_handle (h);sa_free_result_mad (&result);return ret; }Signature · 1 line
1.7.8.2
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html