infiniband-diags: Verify timeout value specified to diagnostics
PATCH 1/1 infiniband-diags: Verify timeout value specified to diagnostics
Verify timeout value specified to diagnostics
Signed-off-by Ira Weiny <[email protected]>
--- infiniband-diags/src/ibdiag_common.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
infiniband-diags/src/ibdiag_common.c +7 -3
@@ -175,9 +175,13 @@ static int process_opt(int ch, char *optarg) ibd_dest_type =IB_DEST_GUID ;break ;case 't' : - val =strtoul (optarg,0 ,0 ); -madrpc_set_timeout (val); - ibd_timeout = val; + val = (int )strtol (optarg,NULL ,0 ); +if (val >0 ) { +madrpc_set_timeout (val); + ibd_timeout = val; + }else +IBERROR ("Invalid timeout \"%s\". Timeout requires a " +"positive integer value." , optarg);break ;case 's' :/* srcport is not required when resolving via IB_DEST_LID */
Signature · 6 lines
1.5.4.5 -- 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): [email protected]
Sasha Khapyorsky
AppliedQuoted 5 lines · Ira Weiny
Verify timeout value specified to diagnostics
Signed-off-by Ira Weiny <[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