All of lore.kernel.org
 help / color / mirror / Atom feed
From: Weihang Li <liweihang@huawei.com>
To: <dledford@redhat.com>, <jgg@ziepe.ca>
Cc: <leon@kernel.org>, <linux-rdma@vger.kernel.org>, <linuxarm@huawei.com>
Subject: [PATCH for-next 02/11] RDMA/hns: Fix a wrong judgment of return value
Date: Thu, 19 Mar 2020 21:24:49 +0800	[thread overview]
Message-ID: <1584624298-23841-3-git-send-email-liweihang@huawei.com> (raw)
In-Reply-To: <1584624298-23841-1-git-send-email-liweihang@huawei.com>

hns_roce_alloc_mtt_range() never return -1, ret should be checked
whether it is zero instead of -1.

Fixes: 1ceb0b11a8a2 ("RDMA/hns: Fix non-standard error codes")
Signed-off-by: Weihang Li <liweihang@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_mr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_mr.c b/drivers/infiniband/hw/hns/hns_roce_mr.c
index b9898e7..176f346 100644
--- a/drivers/infiniband/hw/hns/hns_roce_mr.c
+++ b/drivers/infiniband/hw/hns/hns_roce_mr.c
@@ -243,7 +243,7 @@ int hns_roce_mtt_init(struct hns_roce_dev *hr_dev, int npages, int page_shift,
 	/* Allocate MTT entry */
 	ret = hns_roce_alloc_mtt_range(hr_dev, mtt->order, &mtt->first_seg,
 				       mtt->mtt_type);
-	if (ret == -1)
+	if (ret)
 		return -ENOMEM;
 
 	return 0;
-- 
2.8.1


  parent reply	other threads:[~2020-03-19 13:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-19 13:24 [PATCH for-next 00/11] RDMA/hns: Various cleanups Weihang Li
2020-03-19 13:24 ` [PATCH for-next 01/11] RDMA/hns: Unify format of prints Weihang Li
2020-03-19 13:24 ` Weihang Li [this message]
2020-03-19 13:24 ` [PATCH for-next 03/11] RDMA/hns: Check return value of kmalloc with macro Weihang Li
2020-03-19 18:18   ` Jason Gunthorpe
2020-03-20  1:44     ` liweihang
2020-03-19 13:24 ` [PATCH for-next 04/11] RDMA/hns: Simplify attribute judgment code Weihang Li
2020-03-19 13:24 ` [PATCH for-next 05/11] RDMA/hns: Optimize hns_roce_alloc_vf_resource() Weihang Li
2020-03-19 13:24 ` [PATCH for-next 06/11] RDMA/hns: Adjust the qp status value sequence of the hardware Weihang Li
2020-03-19 13:24 ` [PATCH for-next 07/11] RDMA/hns: Remove definition of cq doorbell structure Weihang Li
2020-03-19 13:24 ` [PATCH for-next 08/11] RDMA/hns: Remove meaningless prints Weihang Li
2020-03-19 13:24 ` [PATCH for-next 09/11] RDMA/hns: Remove redundant qpc setup operations Weihang Li
2020-03-19 13:24 ` [PATCH for-next 10/11] RDMA/hns: Remove redundant assignment of wc->smac when polling cq Weihang Li
2020-03-19 13:24 ` [PATCH for-next 11/11] RDMA/hns: Remove redundant judgment of qp_type Weihang Li

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=1584624298-23841-3-git-send-email-liweihang@huawei.com \
    --to=liweihang@huawei.com \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@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.