summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel
diff options
context:
space:
mode:
authorJia-Ju Bai <baijiaju1990@163.com>2015-08-05 22:05:16 +0800
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2015-08-18 14:06:06 -0700
commit42ad1a03b4caf4d95b980bce17c46242e6728ddc (patch)
treedbd0a6114121108580e9e6cafea921adaab256a1 /drivers/net/ethernet/intel
parent0845d45e900cad5f7f855a7a6a21c33477800b1f (diff)
downloadtalos-obmc-linux-42ad1a03b4caf4d95b980bce17c46242e6728ddc.tar.gz
talos-obmc-linux-42ad1a03b4caf4d95b980bce17c46242e6728ddc.zip
igb: Fix a memory leak in igb_probe
In error handling code of igb_probe, the memory adapter->shadow_vfta allocated by kcalloc in igb_sw_init is not freed. So when register_netdev or igb_init_i2c is failed, a memory leak will occur. This patch adds kfree to fix it. Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 17c1c842c33d..1ebdb461fed3 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2649,6 +2649,7 @@ err_eeprom:
if (hw->flash_address)
iounmap(hw->flash_address);
err_sw_init:
+ kfree(adapter->shadow_vfta);
igb_clear_interrupt_scheme(adapter);
pci_iounmap(pdev, hw->hw_addr);
err_ioremap:
OpenPOWER on IntegriCloud