Skip to contentSkip to conversation

libibmad: To handle null dev_name in madrpc_init

PATCH Applied Boris Chiu 2 participants 2 messages Mar 12, 2013 – Mar 20, 2013 1 message not in the archive InfiniBand

lore
Share & tools
lore

Boris Chiu

author
#0 lore raw

PATCH 1/1 libibmad: To handle null dev_name in madrpc_init

From: Brendan Doyle <[email protected]>

---
src/rpc.c | 3 ++-

1 files changed, 2 insertions(+), 1 deletions(-)
src/rpc.c +0 -0
index 6312d42..cb224fd 100644
@@ -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
Applied
#2 lore raw
In reply to a message not in the archive
Quoted 3 lines · Boris Chiu

From: 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
index 6312d42..cb224fd 100644
@@ -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