]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: set ini->smcrv2.ib_dev_v2 to NULL if SMC-Rv2 is unavailable
authorliuyacan <liuyacan@corp.netease.com>
Wed, 25 May 2022 08:54:08 +0000 (16:54 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 26 May 2022 04:58:41 +0000 (21:58 -0700)
commit9d31d51064fddac69c8a63c274c38fce36b380d9
tree3a77a261d6251bd36e6ce9605ee9a2050ce8fa7c
parentd8a7fc4b3cfe9330c63ca9fa3a215ba22c81b6cb
net/smc: set ini->smcrv2.ib_dev_v2 to NULL if SMC-Rv2 is unavailable

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: bf906f72e99a ("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>
net/smc/af_smc.c