osmtest/osmt_slvl_vl_arb.c: handling fopen() failure
PATCH 1/1 osmtest/osmt_slvl_vl_arb.c: handling fopen() failure
Signed-off-by Yevgeny Kliteynik <[email protected]>
--- opensm/osmtest/osmt_slvl_vl_arb.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)
opensm/osmtest/osmt_slvl_vl_arb.c +8 -1
@@ -489,6 +489,12 @@ osmt_run_slvl_and_vlarb_records_flow(IN osmtest_t * const p_osmt)OSM_LOG_ENTER (&p_osmt->log); fh =fopen ("qos.txt" ,"w" ); +if (!fh) { +OSM_LOG (&p_osmt->log,OSM_LOG_ERROR ,"ERR 0474: " +"Failed to open file qos.txt for writing\n" ); + status =IB_ERROR ; + goto Exit; + }/* go over all ports in the subnet */ status =osmt_query_all_ports_vl_arb (p_osmt, fh);
@@ -520,7 +526,8 @@ osmt_run_slvl_and_vlarb_records_flow(IN osmtest_t * const p_osmt) } Exit: -fclose (fh); +if (fh) +fclose (fh);OSM_LOG_EXIT (&p_osmt->log);return status; }
Signature · 6 lines
1.6.2.4 -- 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): 4C865521.4080600-VPRAkNaXOzVS1MOuV/[email protected]
Sasha Khapyorsky
AppliedQuoted 2 lines · Yevgeny Kliteynik
Signed-off-by Yevgeny Kliteynik <[email protected]>
Applied. Thanks.
Sasha
--
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