diff options
author | liuyacan <liuyacan@corp.netease.com> | 2022-05-25 16:54:08 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-06-14 18:44:54 +0200 |
commit | 776fcaf8601d283a867d664e68bbd53ff40e332f (patch) | |
tree | 413d02f3ce3a6c74d9f132be829ec362466fa9f0 | |
parent | 1808f7c9f2c60cbc28d362360faf5e87e3766e0d (diff) |
net/smc: set ini->smcrv2.ib_dev_v2 to NULL if SMC-Rv2 is unavailable
[ Upstream commit b3b1a17538d3ef6a9667b2271216fd16d7678ab5 ]
In the process of checking whether RDMAv2 is available, the current
implementation first sets ini->smcrv2.ib_dev_v2, and then allocates
smc buf desc and register rmb, but the latter may fail. In this case,
the pointer should be reset.
Fixes: e49300a6bf62 ("net/smc: add listen processing for SMC-Rv2")
Signed-off-by: liuyacan <liuyacan@corp.netease.com>
Reviewed-by: Karsten Graul <kgraul@linux.ibm.com>
Link: https://lore.kernel.org/r/20220525085408.812273-1-liuyacan@corp.netease.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | net/smc/af_smc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index 45a24d24210f0..540b32d86d9b1 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -2136,6 +2136,7 @@ static void smc_find_rdma_v2_device_serv(struct smc_sock *new_smc, not_found: ini->smcr_version &= ~SMC_V2; + ini->smcrv2.ib_dev_v2 = NULL; ini->check_smcrv2 = false; } |