All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Yongjun <weiyongjun1@huawei.com>
To: Lijun Ou <oulijun@huawei.com>,
	"Wei Hu(Xavier)" <xavier.huwei@huawei.com>,
	Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	"Colin Ian King" <colin.king@canonical.com>
Cc: Wei Yongjun <weiyongjun1@huawei.com>,
	<linux-rdma@vger.kernel.org>, <kernel-janitors@vger.kernel.org>
Subject: [PATCH] RDMA/hns: Fix error return code in hns_roce_v1_rsv_lp_qp()
Date: Thu, 1 Aug 2019 01:27:25 +0000	[thread overview]
Message-ID: <20190801012725.150493-1-weiyongjun1@huawei.com> (raw)

Fix to return error code -ENOMEM from the rdma_zalloc_drv_obj() error
handling case instead of 0, as done elsewhere in this function.

Fixes: e8ac9389f0d7 ("RDMA: Fix allocation failure on pointer pd")
Fixes: 21a428a019c9 ("RDMA: Handle PD allocations by IB/core")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index 70583f82e290..aa8a660ffcda 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -750,8 +750,10 @@ static int hns_roce_v1_rsv_lp_qp(struct hns_roce_dev *hr_dev)
 	atomic_set(&free_mr->mr_free_cq->ib_cq.usecnt, 0);
 
 	pd = rdma_zalloc_drv_obj(ibdev, ib_pd);
-	if (!pd)
+	if (!pd) {
+		ret = -ENOMEM;
 		goto alloc_mem_failed;
+	}
 
 	pd->device  = ibdev;
 	ret = hns_roce_alloc_pd(pd, NULL);




WARNING: multiple messages have this Message-ID (diff)
From: Wei Yongjun <weiyongjun1@huawei.com>
To: Lijun Ou <oulijun@huawei.com>,
	"Wei Hu(Xavier)" <xavier.huwei@huawei.com>,
	Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Colin Ian King <colin.king@canonical.com>
Cc: Wei Yongjun <weiyongjun1@huawei.com>,
	linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] RDMA/hns: Fix error return code in hns_roce_v1_rsv_lp_qp()
Date: Thu, 01 Aug 2019 01:27:25 +0000	[thread overview]
Message-ID: <20190801012725.150493-1-weiyongjun1@huawei.com> (raw)

Fix to return error code -ENOMEM from the rdma_zalloc_drv_obj() error
handling case instead of 0, as done elsewhere in this function.

Fixes: e8ac9389f0d7 ("RDMA: Fix allocation failure on pointer pd")
Fixes: 21a428a019c9 ("RDMA: Handle PD allocations by IB/core")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index 70583f82e290..aa8a660ffcda 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -750,8 +750,10 @@ static int hns_roce_v1_rsv_lp_qp(struct hns_roce_dev *hr_dev)
 	atomic_set(&free_mr->mr_free_cq->ib_cq.usecnt, 0);
 
 	pd = rdma_zalloc_drv_obj(ibdev, ib_pd);
-	if (!pd)
+	if (!pd) {
+		ret = -ENOMEM;
 		goto alloc_mem_failed;
+	}
 
 	pd->device  = ibdev;
 	ret = hns_roce_alloc_pd(pd, NULL);

             reply	other threads:[~2019-08-01  1:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01  1:27 Wei Yongjun [this message]
2019-08-01  1:27 ` [PATCH] RDMA/hns: Fix error return code in hns_roce_v1_rsv_lp_qp() Wei Yongjun
2019-08-01  7:54 ` Leon Romanovsky
2019-08-01  7:54   ` Leon Romanovsky
2019-08-01 16:58 ` Doug Ledford
2019-08-01 16:58   ` Doug Ledford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190801012725.150493-1-weiyongjun1@huawei.com \
    --to=weiyongjun1@huawei.com \
    --cc=colin.king@canonical.com \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=oulijun@huawei.com \
    --cc=xavier.huwei@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.