On Tue, Dec 23, 2014 at 12:47 PM, Jia-Ju Bai <baijiaju1...@163.com> wrote:
> 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 <baijiaju1...@163.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);
Why dont you use devm_kcalloc()..? So no need to worry about freeing it.
>         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 majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Thanks and Regards,
Varka Bhadram.

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit 
http://communities.intel.com/community/wired

Reply via email to