]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx4_core: fix memory leaks on error exit path
authorColin Ian King <colin.king@canonical.com>
Thu, 31 Aug 2017 16:30:53 +0000 (17:30 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 3 Sep 2017 17:57:10 +0000 (10:57 -0700)
commit36c7fc2313ec0765f4b91707e0e93d0f5309281f
treef6b470e7e89468cb70fbdf0345e1d76d05700863
parent231d9e6b3e97249b38d47c8430d63af6ed60c015
net/mlx4_core: fix memory leaks on error exit path

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: 899b0b58e07e ("net/mlx4_core: Dynamically allocate structs at mlx4_slave_cap")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/main.c