netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/9 net-next-2.6] qlcnic: Make PCI info available in all modes
@ 2011-04-02  0:07 anirban.chakraborty
  2011-04-02  0:07 ` [PATCH 2/9 net-next-2.6] qlcnic: Memory leak fix anirban.chakraborty
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: anirban.chakraborty @ 2011-04-02  0:07 UTC (permalink / raw)
  To: netdev; +Cc: davem, Dept_NX_Linux_NIC_driver, Sony Chacko

From: Sony Chacko <sony.chacko@qlogic.com>

Before this fix, PCI info was available only when multiple NIC functions
are present on the same port.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
---
 drivers/net/qlcnic/qlcnic_main.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index cd88c7e..d230fdd 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -3954,14 +3954,14 @@ qlcnic_create_diag_entries(struct qlcnic_adapter *adapter)
 		dev_info(dev, "failed to create crb sysfs entry\n");
 	if (device_create_bin_file(dev, &bin_attr_mem))
 		dev_info(dev, "failed to create mem sysfs entry\n");
+	if (device_create_bin_file(dev, &bin_attr_pci_config))
+		dev_info(dev, "failed to create pci config sysfs entry");
 	if (!(adapter->flags & QLCNIC_ESWITCH_ENABLED))
 		return;
 	if (device_create_bin_file(dev, &bin_attr_esw_config))
 		dev_info(dev, "failed to create esw config sysfs entry");
 	if (adapter->op_mode != QLCNIC_MGMT_FUNC)
 		return;
-	if (device_create_bin_file(dev, &bin_attr_pci_config))
-		dev_info(dev, "failed to create pci config sysfs entry");
 	if (device_create_bin_file(dev, &bin_attr_npar_config))
 		dev_info(dev, "failed to create npar config sysfs entry");
 	if (device_create_bin_file(dev, &bin_attr_pm_config))
@@ -3982,12 +3982,12 @@ qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter)
 	device_remove_file(dev, &dev_attr_diag_mode);
 	device_remove_bin_file(dev, &bin_attr_crb);
 	device_remove_bin_file(dev, &bin_attr_mem);
+	device_remove_bin_file(dev, &bin_attr_pci_config);
 	if (!(adapter->flags & QLCNIC_ESWITCH_ENABLED))
 		return;
 	device_remove_bin_file(dev, &bin_attr_esw_config);
 	if (adapter->op_mode != QLCNIC_MGMT_FUNC)
 		return;
-	device_remove_bin_file(dev, &bin_attr_pci_config);
 	device_remove_bin_file(dev, &bin_attr_npar_config);
 	device_remove_bin_file(dev, &bin_attr_pm_config);
 	device_remove_bin_file(dev, &bin_attr_esw_stats);
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [PATCH 2/9 net-next-2.6] qlcnic: Memory leak fix
@ 2011-04-02  0:27 anirban.chakraborty
  0 siblings, 0 replies; 10+ messages in thread
From: anirban.chakraborty @ 2011-04-02  0:27 UTC (permalink / raw)
  To: davem; +Cc: netdev, amit.salecha, ameen.rahman, Sony Chacko

From: Sony Chacko <sony.chacko@qlogic.com>

Fix a memory leak in error path of pci info.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
---
 drivers/net/qlcnic/qlcnic_main.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index d230fdd..de6f866 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -464,8 +464,10 @@ qlcnic_init_pci_info(struct qlcnic_adapter *adapter)
 
 	for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) {
 		pfn = pci_info[i].id;
-		if (pfn > QLCNIC_MAX_PCI_FUNC)
-			return QL_STATUS_INVALID_PARAM;
+		if (pfn > QLCNIC_MAX_PCI_FUNC) {
+			ret = QL_STATUS_INVALID_PARAM;
+			goto err_eswitch;
+		}
 		adapter->npars[pfn].active = (u8)pci_info[i].active;
 		adapter->npars[pfn].type = (u8)pci_info[i].type;
 		adapter->npars[pfn].phy_port = (u8)pci_info[i].default_port;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-04-02  0:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-02  0:07 [PATCH 1/9 net-next-2.6] qlcnic: Make PCI info available in all modes anirban.chakraborty
2011-04-02  0:07 ` [PATCH 2/9 net-next-2.6] qlcnic: Memory leak fix anirban.chakraborty
2011-04-02  0:07 ` [PATCH 3/9 net-next-2.6] qlcnic: Cleanup patch anirban.chakraborty
2011-04-02  0:07 ` [PATCH 4/9 net-next-2.6] qlcnic: Code optimization patch anirban.chakraborty
2011-04-02  0:07 ` [PATCH 5/9 net-next-2.6] qlcnic: Changes to VLAN code anirban.chakraborty
2011-04-02  0:07 ` [PATCH 6/9 net-next-2.6] qlcnic: Remove unused code anirban.chakraborty
2011-04-02  0:07 ` [PATCH 7/9 net-next-2.6] qlcnic: Use flt method to determine flash fw region anirban.chakraborty
2011-04-02  0:07 ` anirban.chakraborty
2011-04-02  0:07 ` anirban.chakraborty
  -- strict thread matches above, loose matches on Subject: below --
2011-04-02  0:27 [PATCH 2/9 net-next-2.6] qlcnic: Memory leak fix anirban.chakraborty

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).