netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net/smc: Fix an error code in smc_lgr_create()
@ 2022-10-14  9:34 Dan Carpenter
  2022-10-14 11:34 ` Wenjia Zhang
  2022-10-15 10:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2022-10-14  9:34 UTC (permalink / raw)
  To: Karsten Graul
  Cc: Wenjia Zhang, Jan Karcher, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, linux-s390, netdev, kernel-janitors

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>
---
 net/smc/smc_core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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);
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net/smc: Fix an error code in smc_lgr_create()
  2022-10-14  9:34 [PATCH net] net/smc: Fix an error code in smc_lgr_create() Dan Carpenter
@ 2022-10-14 11:34 ` Wenjia Zhang
  2022-10-15 10:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Wenjia Zhang @ 2022-10-14 11:34 UTC (permalink / raw)
  To: Dan Carpenter, Karsten Graul
  Cc: Jan Karcher, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, linux-s390, netdev, kernel-janitors



On 14.10.22 11:34, Dan Carpenter wrote:
> 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>
> ---
>   net/smc/smc_core.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> 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);
>   

Good catch! Thank you for your effort!
Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net/smc: Fix an error code in smc_lgr_create()
  2022-10-14  9:34 [PATCH net] net/smc: Fix an error code in smc_lgr_create() Dan Carpenter
  2022-10-14 11:34 ` Wenjia Zhang
@ 2022-10-15 10:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-10-15 10:20 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: kgraul, wenjia, jaka, davem, edumazet, kuba, pabeni, linux-s390,
	netdev, kernel-janitors

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Fri, 14 Oct 2022 12:34:36 +0300 you wrote:
> 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>
> ---
>  net/smc/smc_core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Here is the summary with links:
  - [net] net/smc: Fix an error code in smc_lgr_create()
    https://git.kernel.org/netdev/net/c/bdee15e8c58b

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-15 10:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-14  9:34 [PATCH net] net/smc: Fix an error code in smc_lgr_create() Dan Carpenter
2022-10-14 11:34 ` Wenjia Zhang
2022-10-15 10:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).