lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 23 Dec 2014 15:17:04 +0800
From:	Jia-Ju Bai <baijiaju1990@....com>
To:	davem@...emloft.net, sergei.shtylyov@...entembedded.com,
	jeffrey.t.kirsher@...el.com, bruce.w.allan@...el.com,
	jesse.brandeburg@...el.com
Cc:	linux.nics@...el.com, e1000-devel@...ts.sourceforge.net,
	netdev@...r.kernel.org, Jia-Ju Bai <baijiaju1990@....com>
Subject: [PATCH v3 3/3] igb: Fix a memory leak in igb_probe

For linux-3.18.0
The driver calls kcalloc to allocate memory for adapter->shadow_vfta
in igb_sw_init, but kfree is not called in error handling of igb_probe.
So when register_netdev or igb_init_i2c is failed, a memory leak occurs.
This patch fixes this problem, and it has been tested in runtime.

Signed-off-by: Jia-Ju Bai <baijiaju1990@....com>
---
 drivers/net/ethernet/intel/igb/igb_main.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 487cd9c..a0be1e5 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2659,6 +2659,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:
-- 
1.7.9.5


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ