diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2022-10-14 12:34:36 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-10-15 11:12:12 +0100 |
commit | bdee15e8c58b450ad736a2b62ef8c7a12548b704 (patch) | |
tree | 28493c88417ae94ce8e1b55ce217a5c981fbcada /net/smc | |
parent | 0c9efbd5c50c64ead434960a404c9c9a097b0403 (diff) |
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: 8799e310fb3f ("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>
Diffstat (limited to 'net/smc')
-rw-r--r-- | net/smc/smc_core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c index e6ee797640b4..c305d8dd23f8 100644 --- a/net/smc/smc_core.c +++ b/net/smc/smc_core.c @@ -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); |