Skip to content

Commit

Permalink
net/smc: set ini->smcrv2.ib_dev_v2 to NULL if SMC-Rv2 is unavailable
Browse files Browse the repository at this point in the history
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: e49300a ("net/smc: add listen processing for SMC-Rv2")
Signed-off-by: liuyacan <[email protected]>
Reviewed-by: Karsten Graul <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
liuyacan authored and kuba-moo committed May 26, 2022
1 parent 215cd98 commit b3b1a17
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/smc/af_smc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2161,6 +2161,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;
}

Expand Down

0 comments on commit b3b1a17

Please sign in to comment.