linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/mlx4_core: Add missed mlx4_free_cmd_mailbox()
@ 2021-02-21 14:35 Chuhong Yuan
  2021-02-21 15:12 ` Tariq Toukan
  2021-02-23  3:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Chuhong Yuan @ 2021-02-21 14:35 UTC (permalink / raw)
  Cc: Tariq Toukan, David S . Miller, Jakub Kicinski, Or Gerlitz,
	Jack Morgenstein, Moni Shoua, netdev, linux-rdma, linux-kernel,
	Chuhong Yuan

mlx4_do_mirror_rule() forgets to call mlx4_free_cmd_mailbox() to
free the memory region allocated by mlx4_alloc_cmd_mailbox() before
an exit.
Add the missed call to fix it.

Fixes: 78efed275117 ("net/mlx4_core: Support mirroring VF DMFS rules on both ports")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index 394f43add85c..a99e71bc7b3c 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -4986,6 +4986,7 @@ static int mlx4_do_mirror_rule(struct mlx4_dev *dev, struct res_fs_rule *fs_rule
 
 	if (!fs_rule->mirr_mbox) {
 		mlx4_err(dev, "rule mirroring mailbox is null\n");
+		mlx4_free_cmd_mailbox(dev, mailbox);
 		return -EINVAL;
 	}
 	memcpy(mailbox->buf, fs_rule->mirr_mbox, fs_rule->mirr_mbox_size);
-- 
2.27.0


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

* Re: [PATCH] net/mlx4_core: Add missed mlx4_free_cmd_mailbox()
  2021-02-21 14:35 [PATCH] net/mlx4_core: Add missed mlx4_free_cmd_mailbox() Chuhong Yuan
@ 2021-02-21 15:12 ` Tariq Toukan
  2021-02-23  3:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Tariq Toukan @ 2021-02-21 15:12 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: David S . Miller, Jakub Kicinski, Or Gerlitz, Jack Morgenstein,
	Moni Shoua, netdev, linux-rdma, linux-kernel



On 2/21/2021 4:35 PM, Chuhong Yuan wrote:
> mlx4_do_mirror_rule() forgets to call mlx4_free_cmd_mailbox() to
> free the memory region allocated by mlx4_alloc_cmd_mailbox() before
> an exit.
> Add the missed call to fix it.
> 
> Fixes: 78efed275117 ("net/mlx4_core: Support mirroring VF DMFS rules on both ports")
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
>   drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
> index 394f43add85c..a99e71bc7b3c 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
> @@ -4986,6 +4986,7 @@ static int mlx4_do_mirror_rule(struct mlx4_dev *dev, struct res_fs_rule *fs_rule
>   
>   	if (!fs_rule->mirr_mbox) {
>   		mlx4_err(dev, "rule mirroring mailbox is null\n");
> +		mlx4_free_cmd_mailbox(dev, mailbox);
>   		return -EINVAL;
>   	}
>   	memcpy(mailbox->buf, fs_rule->mirr_mbox, fs_rule->mirr_mbox_size);
> 

Reviewed-by: Tariq Toukan <tariqt@nvidia.com>

Thanks for your patch.
Tariq

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

* Re: [PATCH] net/mlx4_core: Add missed mlx4_free_cmd_mailbox()
  2021-02-21 14:35 [PATCH] net/mlx4_core: Add missed mlx4_free_cmd_mailbox() Chuhong Yuan
  2021-02-21 15:12 ` Tariq Toukan
@ 2021-02-23  3:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-02-23  3:20 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: tariqt, davem, kuba, ogerlitz, jackm, monis, netdev, linux-rdma,
	linux-kernel

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Sun, 21 Feb 2021 22:35:59 +0800 you wrote:
> mlx4_do_mirror_rule() forgets to call mlx4_free_cmd_mailbox() to
> free the memory region allocated by mlx4_alloc_cmd_mailbox() before
> an exit.
> Add the missed call to fix it.
> 
> Fixes: 78efed275117 ("net/mlx4_core: Support mirroring VF DMFS rules on both ports")
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> 
> [...]

Here is the summary with links:
  - net/mlx4_core: Add missed mlx4_free_cmd_mailbox()
    https://git.kernel.org/netdev/net/c/8eb65fda4a6d

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:[~2021-02-23  3:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-21 14:35 [PATCH] net/mlx4_core: Add missed mlx4_free_cmd_mailbox() Chuhong Yuan
2021-02-21 15:12 ` Tariq Toukan
2021-02-23  3: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).