* [PATCH v3 1/3] igb: Add igb_disable_sriov in error handling
@ 2014-12-23 7:17 Jia-Ju Bai
2014-12-23 7:17 ` [PATCH v3 2/3] igb: Add pci_disable_pcie_error_reporting " Jia-Ju Bai
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Jia-Ju Bai @ 2014-12-23 7:17 UTC (permalink / raw)
To: davem, sergei.shtylyov, jeffrey.t.kirsher, bruce.w.allan,
jesse.brandeburg
Cc: e1000-devel, netdev, Jia-Ju Bai, linux.nics
For linux-3.18.0
The driver lacks igb_disable_sriov in error handling,
which should match igb_enable_sriov in igb_probe.
This patch fixes this problem, and it has been tested in runtime.
Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 487cd9c..91914e4 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -179,6 +179,7 @@ static void igb_check_vf_rate_limit(struct igb_adapter *);
#ifdef CONFIG_PCI_IOV
static int igb_vf_configure(struct igb_adapter *adapter, int vf);
static int igb_pci_enable_sriov(struct pci_dev *dev, int num_vfs);
+static int igb_disable_sriov(struct pci_dev *pdev);
#endif
#ifdef CONFIG_PM
@@ -2653,6 +2654,9 @@ err_register:
igb_release_hw_control(adapter);
memset(&adapter->i2c_adap, 0, sizeof(adapter->i2c_adap));
err_eeprom:
+#ifdef CONFIG_PCI_IOV
+ igb_disable_sriov(pdev);
+#endif
if (!igb_check_reset_block(hw))
igb_reset_phy(hw);
--
1.7.9.5
------------------------------------------------------------------------------
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® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH v3 2/3] igb: Add pci_disable_pcie_error_reporting in error handling
2014-12-23 7:17 [PATCH v3 1/3] igb: Add igb_disable_sriov in error handling Jia-Ju Bai
@ 2014-12-23 7:17 ` Jia-Ju Bai
2014-12-23 7:17 ` [PATCH v3 3/3] igb: Fix a memory leak in igb_probe Jia-Ju Bai
2014-12-23 11:23 ` [PATCH v3 1/3] igb: Add igb_disable_sriov in error handling Sergei Shtylyov
2 siblings, 0 replies; 8+ messages in thread
From: Jia-Ju Bai @ 2014-12-23 7:17 UTC (permalink / raw)
To: davem, sergei.shtylyov, jeffrey.t.kirsher, bruce.w.allan,
jesse.brandeburg
Cc: e1000-devel, netdev, Jia-Ju Bai, linux.nics
For linux-3.18.0
The driver lacks pci_disable_pcie_error_reporting in error handling,
which should match pci_enable_pcie_error_reporting in igb_probe.
This patch fixes this problem, and it has been tested in runtime.
Signed-off-by: Jia-Ju Bai <baijiaju1990@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..59e0ba4 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2664,6 +2664,7 @@ err_sw_init:
err_ioremap:
free_netdev(netdev);
err_alloc_etherdev:
+ pci_disable_pcie_error_reporting(pdev);
pci_release_selected_regions(pdev,
pci_select_bars(pdev, IORESOURCE_MEM));
err_pci_reg:
--
1.7.9.5
------------------------------------------------------------------------------
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® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 3/3] igb: Fix a memory leak in igb_probe
2014-12-23 7:17 [PATCH v3 1/3] igb: Add igb_disable_sriov in error handling Jia-Ju Bai
2014-12-23 7:17 ` [PATCH v3 2/3] igb: Add pci_disable_pcie_error_reporting " Jia-Ju Bai
@ 2014-12-23 7:17 ` Jia-Ju Bai
2014-12-23 7:29 ` Varka Bhadram
2014-12-23 11:23 ` [PATCH v3 1/3] igb: Add igb_disable_sriov in error handling Sergei Shtylyov
2 siblings, 1 reply; 8+ messages in thread
From: Jia-Ju Bai @ 2014-12-23 7:17 UTC (permalink / raw)
To: davem, sergei.shtylyov, jeffrey.t.kirsher, bruce.w.allan,
jesse.brandeburg
Cc: e1000-devel, netdev, Jia-Ju Bai, linux.nics
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@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);
igb_clear_interrupt_scheme(adapter);
pci_iounmap(pdev, hw->hw_addr);
err_ioremap:
--
1.7.9.5
------------------------------------------------------------------------------
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® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3 3/3] igb: Fix a memory leak in igb_probe
2014-12-23 7:17 ` [PATCH v3 3/3] igb: Fix a memory leak in igb_probe Jia-Ju Bai
@ 2014-12-23 7:29 ` Varka Bhadram
0 siblings, 0 replies; 8+ messages in thread
From: Varka Bhadram @ 2014-12-23 7:29 UTC (permalink / raw)
To: Jia-Ju Bai
Cc: davem@davemloft.net, Sergei Shtylyov, Kirsher, Jeffrey T,
Allan, Bruce W, Brandeburg, Jesse, <linux.nics@intel.com>,
e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org
On Tue, Dec 23, 2014 at 12:47 PM, Jia-Ju Bai <baijiaju1990@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 <baijiaju1990@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 majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Thanks and Regards,
Varka Bhadram.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 1/3] igb: Add igb_disable_sriov in error handling
2014-12-23 7:17 [PATCH v3 1/3] igb: Add igb_disable_sriov in error handling Jia-Ju Bai
2014-12-23 7:17 ` [PATCH v3 2/3] igb: Add pci_disable_pcie_error_reporting " Jia-Ju Bai
2014-12-23 7:17 ` [PATCH v3 3/3] igb: Fix a memory leak in igb_probe Jia-Ju Bai
@ 2014-12-23 11:23 ` Sergei Shtylyov
2014-12-23 13:22 ` Jia-Ju Bai
2 siblings, 1 reply; 8+ messages in thread
From: Sergei Shtylyov @ 2014-12-23 11:23 UTC (permalink / raw)
To: Jia-Ju Bai, davem, jeffrey.t.kirsher, bruce.w.allan,
jesse.brandeburg
Cc: linux.nics, e1000-devel, netdev
Hello.
On 12/23/2014 10:17 AM, Jia-Ju Bai wrote:
> For linux-3.18.0
For the future: such words should be placed under --- tear line...
> The driver lacks igb_disable_sriov in error handling,
> which should match igb_enable_sriov in igb_probe.
> This patch fixes this problem, and it has been tested in runtime.
> Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
> ---
.... here.
> drivers/net/ethernet/intel/igb/igb_main.c | 4 ++++
> 1 file changed, 4 insertions(+)
WBR, Sergei
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH v3 1/3] igb: Add igb_disable_sriov in error handling
2014-12-23 11:23 ` [PATCH v3 1/3] igb: Add igb_disable_sriov in error handling Sergei Shtylyov
@ 2014-12-23 13:22 ` Jia-Ju Bai
2014-12-23 14:03 ` Jeff Kirsher
0 siblings, 1 reply; 8+ messages in thread
From: Jia-Ju Bai @ 2014-12-23 13:22 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: linux.nics, e1000-devel, netdev, bruce.w.allan, jesse.brandeburg,
davem
On 12/23/2014 07:23 PM, Sergei Shtylyov wrote:
> Hello.
>
> On 12/23/2014 10:17 AM, Jia-Ju Bai wrote:
>
>> For linux-3.18.0
>
> For the future: such words should be placed under --- tear line...
>
>> The driver lacks igb_disable_sriov in error handling,
>> which should match igb_enable_sriov in igb_probe.
>> This patch fixes this problem, and it has been tested in runtime.
>
>> Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
>> ---
>
> .... here.
>
>> drivers/net/ethernet/intel/igb/igb_main.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>
> WBR, Sergei
>
Thanks. ^_^
I see that most patches in netdev mailing list do not mention the linux
kernel version, so is it necessary to write the version in the patch?
------------------------------------------------------------------------------
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® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 1/3] igb: Add igb_disable_sriov in error handling
2014-12-23 13:22 ` Jia-Ju Bai
@ 2014-12-23 14:03 ` Jeff Kirsher
2014-12-23 15:06 ` Jia-Ju Bai
0 siblings, 1 reply; 8+ messages in thread
From: Jeff Kirsher @ 2014-12-23 14:03 UTC (permalink / raw)
To: Jia-Ju Bai
Cc: Sergei Shtylyov, davem, bruce.w.allan, jesse.brandeburg,
linux.nics, e1000-devel, netdev
[-- Attachment #1: Type: text/plain, Size: 1607 bytes --]
On Tue, 2014-12-23 at 21:22 +0800, Jia-Ju Bai wrote:
> On 12/23/2014 07:23 PM, Sergei Shtylyov wrote:
> > Hello.
> >
> > On 12/23/2014 10:17 AM, Jia-Ju Bai wrote:
> >
> >> For linux-3.18.0
> >
> > For the future: such words should be placed under --- tear line...
> >
> >> The driver lacks igb_disable_sriov in error handling,
> >> which should match igb_enable_sriov in igb_probe.
> >> This patch fixes this problem, and it has been tested in runtime.
> >
> >> Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
> >> ---
> >
> > .... here.
> >
> >> drivers/net/ethernet/intel/igb/igb_main.c | 4 ++++
> >> 1 file changed, 4 insertions(+)
> >
> > WBR, Sergei
> >
>
> Thanks. ^_^
> I see that most patches in netdev mailing list do not mention the linux
> kernel version, so is it necessary to write the version in the patch?
>
No it is not. If you were sending a patch (which has already been
accepted upstream) to the stable trees, then you would specify what
stable kernels the patch applies to. In your case, I would not consider
your patches critical for the stable trees.
So when sending patches, you inform the maintainer (i.e. me) what tree
you want your patch applied by stating either "net" or "net-next" in the
title. For example, this patch would be titled:
[net v3 1/3] igb: Add igb_disable_sriov in error handling
Which lets me know you want your patch applied to the "net" tree. If it
were not a fix, then it would go into the "net-next" tree by using the
title:
[net-next v3 1/3] igb: Add igb_disable_sriov in error handling
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 1/3] igb: Add igb_disable_sriov in error handling
2014-12-23 14:03 ` Jeff Kirsher
@ 2014-12-23 15:06 ` Jia-Ju Bai
0 siblings, 0 replies; 8+ messages in thread
From: Jia-Ju Bai @ 2014-12-23 15:06 UTC (permalink / raw)
To: Jeff Kirsher
Cc: linux.nics, Sergei Shtylyov, e1000-devel, netdev, bruce.w.allan,
jesse.brandeburg, davem
On 12/23/2014 10:03 PM, Jeff Kirsher wrote:
>
> No it is not. If you were sending a patch (which has already been
> accepted upstream) to the stable trees, then you would specify what
> stable kernels the patch applies to. In your case, I would not consider
> your patches critical for the stable trees.
>
> So when sending patches, you inform the maintainer (i.e. me) what tree
> you want your patch applied by stating either "net" or "net-next" in the
> title. For example, this patch would be titled:
>
> [net v3 1/3] igb: Add igb_disable_sriov in error handling
>
> Which lets me know you want your patch applied to the "net" tree. If it
> were not a fix, then it would go into the "net-next" tree by using the
> title:
>
> [net-next v3 1/3] igb: Add igb_disable_sriov in error handling
>
>
Thanks!
------------------------------------------------------------------------------
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® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-12-23 15:06 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-23 7:17 [PATCH v3 1/3] igb: Add igb_disable_sriov in error handling Jia-Ju Bai
2014-12-23 7:17 ` [PATCH v3 2/3] igb: Add pci_disable_pcie_error_reporting " Jia-Ju Bai
2014-12-23 7:17 ` [PATCH v3 3/3] igb: Fix a memory leak in igb_probe Jia-Ju Bai
2014-12-23 7:29 ` Varka Bhadram
2014-12-23 11:23 ` [PATCH v3 1/3] igb: Add igb_disable_sriov in error handling Sergei Shtylyov
2014-12-23 13:22 ` Jia-Ju Bai
2014-12-23 14:03 ` Jeff Kirsher
2014-12-23 15:06 ` Jia-Ju Bai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).