net/smc: Fix an error code in smc_lgr_create()

If smc_wr_alloc_lgr_mem() fails then return an error code.  Don't return
success.

Fixes: 8799e310fb ("net/smc: add v2 support to the work request layer")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Dan Carpenter 2022-10-14 12:34:36 +03:00 committed by David S. Miller
parent 0c9efbd5c5
commit bdee15e8c5

View File

@ -896,7 +896,8 @@ static int smc_lgr_create(struct smc_sock *smc, struct smc_init_info *ini)
}
memcpy(lgr->pnet_id, ibdev->pnetid[ibport - 1],
SMC_MAX_PNETID_LEN);
if (smc_wr_alloc_lgr_mem(lgr))
rc = smc_wr_alloc_lgr_mem(lgr);
if (rc)
goto free_wq;
smc_llc_lgr_init(lgr, smc);