From: Nicholas Bellinger <[email protected]>

This patch fixes a bug in srpt_make_nodeacl(), where a failure of
srpt_alloc_fabric_acl() was not setting a proper error return code.

Reported-by: Bart Van Assche <[email protected]>
Cc: Bart Van Assche <[email protected]>
Cc: Roland Dreier <[email protected]>
Signed-off-by: Nicholas A. Bellinger <[email protected]>
---
 drivers/infiniband/ulp/srpt/ib_srpt.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c 
b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 6aba709..fee78b0 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -3679,8 +3679,10 @@ static struct se_node_acl *srpt_make_nodeacl(struct 
se_portal_group *tpg,
        }
 
        se_nacl_new = srpt_alloc_fabric_acl(tpg);
-       if (!se_nacl_new)
+       if (!se_nacl_new) {
+               ret = -ENOMEM;
                goto err;
+       }
        /*
         * nacl_new may be released by core_tpg_add_initiator_node_acl()
         * when converting a node ACL from demo mode to explict
-- 
1.7.2.5

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