lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1669377831-41386-1-git-send-email-wangyufen@huawei.com>
Date:   Fri, 25 Nov 2022 20:03:50 +0800
From:   Wang Yufen <wangyufen@...wei.com>
To:     <bvanassche@....org>, <jgg@...pe.ca>, <leon@...nel.org>,
        <dennis.dalessandro@...nelisnetworks.com>
CC:     <linux-rdma@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <andriy.shevchenko@...ux.intel.com>, <bart.vanassche@....com>,
        <easwar.hariharan@...el.com>, Wang Yufen <wangyufen@...wei.com>
Subject: [PATCH 1/2] RDMA/hfi1: Fix error return code in parse_platform_config()

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@...wei.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ