From: Wei Yongjun <[email protected]>

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 <[email protected]>
---
 drivers/infiniband/ulp/srpt/ib_srpt.c | 3 +++
 1 file changed, 3 insertions(+)

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;

--
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

Reply via email to