lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 3 Sep 2017 10:19:52 +0300
From:   Tariq Toukan <tariqt@...lanox.com>
To:     Colin King <colin.king@...onical.com>,
        Tariq Toukan <tariqt@...lanox.com>, netdev@...r.kernel.org,
        linux-rdma@...r.kernel.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] net/mlx4_core: fix memory leaks on error exit path


On 31/08/2017 7:30 PM, Colin King wrote:
> From: Colin Ian King <colin.king@...onical.com>
> 
> The structures hca_param and func_cap are not being kfree'd on an error
> exit path causing two memory leaks. Fix this by jumping to the existing
> free memory error exit path.
> 
> Detected by CoverityScan, CID#1455219, CID#1455224 ("Resource Leak")
> 
> Fixes: c73c8b1e47ca ("net/mlx4_core: Dynamically allocate structs at mlx4_slave_cap")
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
> ---
>   drivers/net/ethernet/mellanox/mlx4/main.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
> index 1c92101b3ec2..d46f3283ec36 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/main.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/main.c
> @@ -977,7 +977,8 @@ static int mlx4_slave_cap(struct mlx4_dev *dev)
>   	if (dev->caps.num_ports > MLX4_MAX_PORTS) {
>   		mlx4_err(dev, "HCA has %d ports, but we only support %d, aborting\n",
>   			 dev->caps.num_ports, MLX4_MAX_PORTS);
> -		return -ENODEV;
> +		err = -ENODEV;
> +		goto free_mem;
>   	}
>   
>   	mlx4_replace_zero_macs(dev);
> 

Acked-by: Tariq Toukan <tariqt@...lanox.com>

Thanks Colin!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ