]> git.itanic.dy.fi Git - linux-stable/commitdiff
net/mlx4_core: Add missed mlx4_free_cmd_mailbox()
authorChuhong Yuan <hslester96@gmail.com>
Sun, 21 Feb 2021 14:35:59 +0000 (22:35 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 08:39:49 +0000 (09:39 +0100)
[ Upstream commit 8eb65fda4a6dbd59cd5de24b106a10b6ee0d2176 ]

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>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://lore.kernel.org/r/20210221143559.390277-1-hslester96@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c

index a4c1ed65f620c035c1f26340ed29c4f5b9bc5708..550e4893253ee866356382e2c4633f6b9b65ab95 100644 (file)
@@ -4990,6 +4990,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);