RDMA/srp: Fix error return code in srp_parse_options()
[ Upstream commit
5944241c328e47e0940c30e7cdcf169ad3c1ce2c ]
In the previous iteration of the while loop, the "ret" may have been
assigned a value of 0, so the error return code -EINVAL may have been
incorrectly set to 0. To fix set valid return code before calling to
goto. Also investigate each case separately as Andy suggessted.
Fixes: fce3ca98bfd6 ("IB/srp: replace custom implementation of hex2bin()")
Fixes: ef2d6e49884a ("IB/srp: Use kstrtoull() instead of simple_strtoull()")
Fixes: 4008c084fbbb ("IB/srp: Add RDMA/CM support")
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
Link: https://lore.kernel.org/r/1669953638-11747-2-git-send-email-wangyufen@huawei.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>