From patchwork Fri Apr 1 04:34:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anirban Chakraborty X-Patchwork-Id: 89176 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B926DB6F81 for ; Fri, 1 Apr 2011 15:35:25 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751529Ab1DAEfS (ORCPT ); Fri, 1 Apr 2011 00:35:18 -0400 Received: from va3ehsobe006.messaging.microsoft.com ([216.32.180.16]:22005 "EHLO VA3EHSOBE006.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751403Ab1DAEfR convert rfc822-to-8bit (ORCPT ); Fri, 1 Apr 2011 00:35:17 -0400 Received: from mail6-va3-R.bigfish.com (10.7.14.246) by VA3EHSOBE006.bigfish.com (10.7.40.26) with Microsoft SMTP Server id 14.1.225.8; Fri, 1 Apr 2011 04:35:16 +0000 Received: from mail6-va3 (localhost.localdomain [127.0.0.1]) by mail6-va3-R.bigfish.com (Postfix) with ESMTP id D5C4F186044D; Fri, 1 Apr 2011 04:35:16 +0000 (UTC) X-SpamScore: 11 X-BigFish: VPS11(zzzz1202hzz8275bhz2ei2a8h637h668h839h1a1r61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:avexcashub1.qlogic.com; RD:avexcashub2.qlogic.com; EFVD:NLI Received: from mail6-va3 (localhost.localdomain [127.0.0.1]) by mail6-va3 (MessageSwitch) id 1301632514912942_23371; Fri, 1 Apr 2011 04:35:14 +0000 (UTC) Received: from VA3EHSMHS028.bigfish.com (unknown [10.7.14.242]) by mail6-va3.bigfish.com (Postfix) with ESMTP id 8186A46005B; Fri, 1 Apr 2011 04:35:14 +0000 (UTC) Received: from avexcashub1.qlogic.com (198.70.193.64) by VA3EHSMHS028.bigfish.com (10.7.99.38) with Microsoft SMTP Server (TLS) id 14.1.225.22; Fri, 1 Apr 2011 04:35:13 +0000 Received: from n5102mn2hhgf91.qlogic.org (10.1.7.24) by avexcashub2.qlogic.org (10.1.4.162) with Microsoft SMTP Server (TLS) id 8.1.436.0; Thu, 31 Mar 2011 21:35:12 -0700 Date: Thu, 31 Mar 2011 21:34:16 -0700 From: Anirban Chakraborty X-X-Sender: anirban@n5102mn2hhgf91.qlogic.org To: David Miller , "netdev@vger.kernel.org" CC: Dept_NX_Linux_NIC_Driver Subject: [PATCH 2/9 net-next-2.6] qlcnic: mem free bug fix in error path Message-ID: User-Agent: Alpine 2.00 (OSX 1167 2008-08-23) MIME-Version: 1.0 X-OriginatorOrg: qlogic.com Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Sony Chacko Fix a memory leak in error path. Signed-off-by: Sony Chacko --- drivers/net/qlcnic/qlcnic_main.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) -- 1.7.4.1 This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message. -- 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 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;