mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-30 17:00:08 -04:00
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: Jack Morgenstein <jackm@dev.mellanox.co.il> Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
f0ce061508
commit
772103e6b1
@@ -2979,8 +2979,10 @@ static int mlx4_load_one(struct pci_dev *pdev, int pci_dev_data,
|
||||
mlx4_free_eq_table(dev);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
if (mlx4_is_slave(dev)) {
|
||||
kfree(dev->caps.qp0_qkey);
|
||||
|
||||
Reference in New Issue
Block a user