All of lore.kernel.org
 help / color / mirror / Atom feed
From: Weihang Li <liweihang@huawei.com>
To: <dledford@redhat.com>, <jgg@nvidia.com>
Cc: <leon@kernel.org>, <linux-rdma@vger.kernel.org>,
	<linuxarm@huawei.com>, Yixing Liu <liuyixing1@huawei.com>,
	Weihang Li <liweihang@huawei.com>
Subject: [PATCH for-next 02/10] RDMA/hns: Fix uninitialized variable
Date: Fri, 18 Jun 2021 18:10:12 +0800	[thread overview]
Message-ID: <1624011020-16992-3-git-send-email-liweihang@huawei.com> (raw)
In-Reply-To: <1624011020-16992-1-git-send-email-liweihang@huawei.com>

From: Yixing Liu <liuyixing1@huawei.com>

A random value will be returned if the condition below is not met, so it
needs to be initialized.

Fixes: 9ea9a53ea93b ("RDMA/hns: Add mapped page count checking for MTR")
Signed-off-by: Yixing Liu <liuyixing1@huawei.com>
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 8e6b1ae..c039743 100644
--- a/drivers/infiniband/hw/hns/hns_roce_mr.c
+++ b/drivers/infiniband/hw/hns/hns_roce_mr.c
@@ -776,7 +776,7 @@ int hns_roce_mtr_map(struct hns_roce_dev *hr_dev, struct hns_roce_mtr *mtr,
 	struct ib_device *ibdev = &hr_dev->ib_dev;
 	struct hns_roce_buf_region *r;
 	unsigned int i, mapped_cnt;
-	int ret;
+	int ret = 0;
 
 	/*
 	 * Only use the first page address as root ba when hopnum is 0, this
-- 
2.7.4


  parent reply	other threads:[~2021-06-18 10:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 10:10 [PATCH for-next 00/10] RDMA/hns: Updates for 5.14 Weihang Li
2021-06-18 10:10 ` [PATCH for-next 01/10] RDMA/hns: Force rewrite inline flag of WQE Weihang Li
2021-06-18 10:10 ` Weihang Li [this message]
2021-06-18 10:10 ` [PATCH for-next 03/10] RDMA/hns: Fix some print issues Weihang Li
2021-06-18 10:10 ` [PATCH for-next 04/10] RDMA/hns: Add member assignments for qp_init_attr Weihang Li
2021-06-18 10:10 ` [PATCH for-next 05/10] RDMA/hns: Delete unnecessary branch of hns_roce_v2_query_qp Weihang Li
2021-06-18 10:10 ` [PATCH for-next 06/10] RDMA/hns: Clean definitions of EQC structure Weihang Li
2021-06-18 10:10 ` [PATCH for-next 07/10] RDMA/hns: Modify function return value type Weihang Li
2021-06-18 10:10 ` [PATCH for-next 08/10] RDMA/hns: Encapsulate flushing CQE as a function Weihang Li
2021-06-18 10:10 ` [PATCH for-next 09/10] RDMA/hns: Simplify the judgment in hns_roce_v2_post_send() Weihang Li
2021-06-18 10:10 ` [PATCH for-next 10/10] RDMA/hns: Fix spelling mistakes of original Weihang Li
2021-06-22 18:25 ` [PATCH for-next 00/10] RDMA/hns: Updates for 5.14 Jason Gunthorpe

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=1624011020-16992-3-git-send-email-liweihang@huawei.com \
    --to=liweihang@huawei.com \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=liuyixing1@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.