From: liuyacan liuyacan@corp.netease.com
mainline inclusion from mainline-v5.19-rc1 commit b3b1a17538d3ef6a9667b2271216fd16d7678ab5 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IAGKJU
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
-------------------------------------------
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: Zhengchao Shao shaozhengchao@huawei.com --- net/smc/af_smc.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index cd362f04aa5f..ce8624702407 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -2153,6 +2153,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; }