net/mlx4: fix handling of probing failure
authorMichael Baum <michaelba@nvidia.com>
Wed, 20 Jan 2021 08:14:51 +0000 (08:14 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 29 Jan 2021 17:16:07 +0000 (18:16 +0100)
commitbcf58b64dafe1a298ee5de2ae018876d2e5c1362
tree64bc8b26fcbd2d0685c7c7477eb9eea5012a798c
parent8e1630e0f1985beb7e48429e3a7614f4732b0e68
net/mlx4: fix handling of probing failure

In mlx4 PCI probing, there are some validations for the Ethernet device
configuration.
From each PCI device the function creates one or two Ethernet devices.

When one of validations fails during the creation of the second device,
the first device is not freed what caused a memory leak.

Free it.

Fixes: 7fae69eeff13 ("mlx4: new poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Tested-by: David Marchand <david.marchand@redhat.com>
drivers/net/mlx4/mlx4.c