From: Jia-Ju Bai Date: Wed, 5 Aug 2015 14:05:16 +0000 (+0800) Subject: igb: Fix a memory leak in igb_probe X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=42ad1a03b4caf4d95b980bce17c46242e6728ddc;p=linux-beck.git 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 Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher --- 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: