[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1669377831-41386-2-git-send-email-wangyufen@huawei.com>
Date: Fri, 25 Nov 2022 20:03:51 +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 2/2] RDMA/srp: Fix error return code in srp_parse_options()
In the previous while loop, "ret" may be assigned zero. Therefore,
"ret" needs to be assigned -EINVAL at the beginning of each loop.
Fixes: e711f968c49c ("IB/srp: replace custom implementation of hex2bin()")
Fixes: 2a174df0c602 ("IB/srp: Use kstrtoull() instead of simple_strtoull()")
Fixes: 19f313438c77 ("IB/srp: Add RDMA/CM support")
Signed-off-by: Wang Yufen <wangyufen@...wei.com>
---
drivers/infiniband/ulp/srp/ib_srp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 1075c2a..1bd3559 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -3352,6 +3352,7 @@ static int srp_parse_options(struct net *net, const char *buf,
sep_opt = options;
while ((p = strsep(&sep_opt, ",\n")) != NULL) {
+ ret = -EINVAL;
if (!*p)
continue;
--
1.8.3.1
Powered by blists - more mailing lists