]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/smc: Fix an error code in smc_lgr_create()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 14 Oct 2022 09:34:36 +0000 (12:34 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 15 Oct 2022 10:12:12 +0000 (11:12 +0100)
If smc_wr_alloc_lgr_mem() fails then return an error code.  Don't return
success.

Fixes: e79ff7378e2c ("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>
net/smc/smc_core.c

index e6ee797640b451e3b54a3215a66f91ebfc2c46fc..c305d8dd23f80c3f8d4ce2b554601721b425321a 100644 (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);