[ofa-general] [PATCH] RDMA/nes: Check cm_node before using it

Chien Tung chien.tin.tung at intel.com
Mon Nov 3 12:05:27 PST 2008


From: Chien Tung <chien.tin.tung at intel.com>

RDMA/nes: Check cm_node before using it

Moved cm_core assignment after cm_node check.

Signed-off-by: Chien Tung <chien.tin.tung at intel.com>
--
 drivers/infiniband/hw/nes/nes_cm.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index 2caf9da..31341fa 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -376,13 +376,16 @@ int schedule_nes_timer(struct nes_cm_node *cm_node, struct sk_buff *skb,
 		int close_when_complete)
 {
 	unsigned long  flags;
-	struct nes_cm_core *cm_core = cm_node->cm_core;
+	struct nes_cm_core *cm_core;
 	struct nes_timer_entry *new_send;
 	int ret = 0;
 	u32 was_timer_set;
 
 	if (!cm_node)
 		return -EINVAL;
+
+	cm_core = cm_node->cm_core;
+
 	new_send = kzalloc(sizeof(*new_send), GFP_ATOMIC);
 	if (!new_send)
 		return -1;



More information about the general mailing list