Commit 772103e6 authored by Jack Morgenstein's avatar Jack Morgenstein Committed by David S. Miller

net/mlx4_core: Fix mem leak in SRIOV mlx4_init_one error flow

Structs allocated for the resource tracker must be freed in
the error flow.
Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: default avatarAmir Vadai <amirv@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f0ce0615
...@@ -2979,8 +2979,10 @@ static int mlx4_load_one(struct pci_dev *pdev, int pci_dev_data, ...@@ -2979,8 +2979,10 @@ static int mlx4_load_one(struct pci_dev *pdev, int pci_dev_data,
mlx4_free_eq_table(dev); mlx4_free_eq_table(dev);
err_master_mfunc: err_master_mfunc:
if (mlx4_is_master(dev)) if (mlx4_is_master(dev)) {
mlx4_free_resource_tracker(dev, RES_TR_FREE_STRUCTS_ONLY);
mlx4_multi_func_cleanup(dev); mlx4_multi_func_cleanup(dev);
}
if (mlx4_is_slave(dev)) { if (mlx4_is_slave(dev)) {
kfree(dev->caps.qp0_qkey); kfree(dev->caps.qp0_qkey);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment