From: anirban.chakraborty@qlogic.com
To: netdev@vger.kernel.org
Cc: davem@davemloft.com, Dept_NX_Linux_NIC_driver@qlogic.com,
Sony Chacko <sony.chacko@qlogic.com>
Subject: [PATCH 2/9 net-next-2.6] qlcnic: Memory leak fix
Date: Fri, 1 Apr 2011 17:07:09 -0700 [thread overview]
Message-ID: <1301702836-3265-2-git-send-email-anirban.chakraborty@qlogic.com> (raw)
In-Reply-To: <1301702836-3265-1-git-send-email-anirban.chakraborty@qlogic.com>
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
next prev parent reply other threads:[~2011-04-02 0:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` anirban.chakraborty [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1301702836-3265-2-git-send-email-anirban.chakraborty@qlogic.com \
--to=anirban.chakraborty@qlogic.com \
--cc=Dept_NX_Linux_NIC_driver@qlogic.com \
--cc=davem@davemloft.com \
--cc=netdev@vger.kernel.org \
--cc=sony.chacko@qlogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).