diff mbox

ib_srpt: fix error return code in srpt_create_ch_ib() and srpt_cm_req_recv()

Message ID CAPgLHd-ZupR6bT6-gi8erzU3i7bVwdSGKYkZH_CbCbOqhtAcVQ@mail.gmail.com (mailing list archive)
State Rejected
Headers show

Commit Message

Wei Yongjun June 5, 2013, 2:17 a.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Fix to return a negative error code in some error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/infiniband/ulp/srpt/ib_srpt.c | 3 +++
 1 file changed, 3 insertions(+)


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 3f3f041..1d9b019 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -2144,6 +2144,7 @@  static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)
 	if (IS_ERR(ch->thread)) {
 		printk(KERN_ERR "failed to create kernel thread %ld\n",
 		       PTR_ERR(ch->thread));
+		ret = PTR_ERR(ch->thread);
 		ch->thread = NULL;
 		goto err_destroy_qp;
 	}
@@ -2589,6 +2590,7 @@  static int srpt_cm_req_recv(struct ib_cm_id *cm_id,
 		       " configured yet for initiator %s.\n", ch->sess_name);
 		rej->reason = __constant_cpu_to_be32(
 				SRP_LOGIN_REJ_CHANNEL_LIMIT_REACHED);
+		ret = -ENOENT;
 		goto destroy_ib;
 	}
 
@@ -2597,6 +2599,7 @@  static int srpt_cm_req_recv(struct ib_cm_id *cm_id,
 		rej->reason = __constant_cpu_to_be32(
 				SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
 		pr_debug("Failed to create session\n");
+		ret = PTR_ERR(ch->sess);
 		goto deregister_session;
 	}
 	ch->sess->se_node_acl = &nacl->nacl;