libibmad: To handle null dev_name in madrpc_init
PATCH 1/1 libibmad: To handle null dev_name in madrpc_init
From: Brendan Doyle <[email protected]>
Signed-off-by Brendan Doyle <[email protected]>
---src/rpc.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
src/rpc.c +0 -0
@@ -360,7 +360,8 @@ madrpc_init(char *dev_name, int dev_port, int *mgmt_classes, int num_classes)
IBPANIC("can't init UMAD library");
if ((fd = umad_open_port(dev_name, dev_port)) < 0)- IBPANIC("can't open UMAD port (%s:%d)", dev_name, dev_port);
+ IBPANIC("can't open UMAD port (%s:%d)",
+ dev_name ? dev_name : "(nil)", dev_port);
if (num_classes >= MAX_CLASS)
IBPANIC("too many classes %d requested", num_classes);Signature · 7 lines
1.7.1 -- 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
Ira Weiny
AppliedQuoted 3 lines · Boris Chiu
From: Brendan Doyle <[email protected]>
Signed-off-by Brendan Doyle <[email protected]>
Thanks applied,
Ira
Quoted 19 lines
---
src/rpc.c| 3 ++-1 files changed, 2 insertions(+), 1 deletions(-)src/rpc.c +2
-1@@ -360,7 +360,8 @@ madrpc_init(char *dev_name, int dev_port, int *mgmt_classes, int num_classes)IBPANIC ("can't init UMAD library" );if ((fd =umad_open_port (dev_name, dev_port)) <0 ) -IBPANIC ("can't open UMAD port (%s:%d)" , dev_name, dev_port); +IBPANIC ("can't open UMAD port (%s:%d)" , + dev_name ? dev_name :"(nil)" , dev_port);if (num_classes >=MAX_CLASS )IBPANIC("too many classes %d requested", num_classes);
Quoted 4 lines
--
1.7.1
--
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