public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Wang Yufen <wangyufen@huawei.com>
To: <bvanassche@acm.org>, <jgg@ziepe.ca>, <leon@kernel.org>,
	<dennis.dalessandro@cornelisnetworks.com>
Cc: <linux-rdma@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<andriy.shevchenko@linux.intel.com>, <bart.vanassche@wdc.com>,
	<easwar.hariharan@intel.com>, Wang Yufen <wangyufen@huawei.com>
Subject: [PATCH 1/2] RDMA/hfi1: Fix error return code in parse_platform_config()
Date: Fri, 25 Nov 2022 20:03:50 +0800	[thread overview]
Message-ID: <1669377831-41386-1-git-send-email-wangyufen@huawei.com> (raw)

In the previous while loop, "ret" may be assigned zero. Therefore,
"ret" needs to be assigned -EINVAL at the beginning of each loop.

Fixes: 97167e813415 ("staging/rdma/hfi1: Tune for unknown channel if configuration file is absent")
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
---
 drivers/infiniband/hw/hfi1/firmware.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/hw/hfi1/firmware.c b/drivers/infiniband/hw/hfi1/firmware.c
index 1d77514..c179dfe 100644
--- a/drivers/infiniband/hw/hfi1/firmware.c
+++ b/drivers/infiniband/hw/hfi1/firmware.c
@@ -1788,6 +1788,7 @@ int parse_platform_config(struct hfi1_devdata *dd)
 	 * being used.
 	 */
 	while (ptr < (u32 *)(dd->platform_config.data + file_length)) {
+		ret = -EINVAL;
 		header1 = *ptr;
 		header2 = *(ptr + 1);
 		if (header1 != ~header2) {
-- 
1.8.3.1


             reply	other threads:[~2022-11-25 11:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25 12:03 Wang Yufen [this message]
2022-11-25 12:03 ` [PATCH 2/2] RDMA/srp: Fix error return code in srp_parse_options() Wang Yufen
2022-11-25 14:37   ` Andy Shevchenko
2022-11-26  1:23     ` wangyufen
2022-11-25 14:31 ` [PATCH 1/2] RDMA/hfi1: Fix error return code in parse_platform_config() Andy Shevchenko

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=1669377831-41386-1-git-send-email-wangyufen@huawei.com \
    --to=wangyufen@huawei.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bart.vanassche@wdc.com \
    --cc=bvanassche@acm.org \
    --cc=dennis.dalessandro@cornelisnetworks.com \
    --cc=easwar.hariharan@intel.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox