From patchwork Thu Apr 8 08:42:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreenivasa Honnur X-Patchwork-Id: 49709 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 2473EB7D30 for ; Thu, 8 Apr 2010 18:42:27 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756005Ab0DHImW (ORCPT ); Thu, 8 Apr 2010 04:42:22 -0400 Received: from barracuda.s2io.com ([72.1.205.138]:38515 "EHLO barracuda.s2io.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753243Ab0DHImV (ORCPT ); Thu, 8 Apr 2010 04:42:21 -0400 X-ASG-Debug-ID: 1270716140-392c00090000-gSecQ8 X-Barracuda-URL: http://72.1.205.138:8000/cgi-bin/mark.cgi Received: from guinness.s2io.com (localhost [127.0.0.1]) by barracuda.s2io.com (Spam & Virus Firewall) with ESMTP id 921AD20D6997; Thu, 8 Apr 2010 04:42:20 -0400 (EDT) Received: from guinness.s2io.com (142-46-210.147.tel-ott.com [142.46.210.147]) by barracuda.s2io.com with ESMTP id PgX5eSnN1ACc1ass; Thu, 08 Apr 2010 04:42:20 -0400 (EDT) X-Barracuda-Envelope-From: Sreenivasa.Honnur@neterion.com X-ASG-Whitelist: Client Received: from guinness.s2io.com (localhost [127.0.0.1]) by guinness.s2io.com (8.12.6/8.12.6) with ESMTP id o388gDmd000388; Thu, 8 Apr 2010 04:42:13 -0400 (EDT) Received: from localhost (shonnur@localhost) by guinness.s2io.com (8.12.6/8.12.6/Submit) with ESMTP id o388g2nf000384; Thu, 8 Apr 2010 04:42:02 -0400 (EDT) Date: Thu, 8 Apr 2010 04:42:02 -0400 (EDT) From: Sreenivasa Honnur To: davem@davemloft.net cc: netdev@vger.kernel.org, support@neterion.com X-ASG-Orig-Subj: net-next-2.6 PATCH 1/4] vxge: Fix a possible memory leak in vxge_hw_device_initialize(). Subject: net-next-2.6 PATCH 1/4] vxge: Fix a possible memory leak in vxge_hw_device_initialize(). Message-ID: MIME-Version: 1.0 X-Barracuda-Connect: 142-46-210.147.tel-ott.com[142.46.210.147] X-Barracuda-Start-Time: 1270716140 X-Barracuda-Virus-Scanned: by Barracuda Spam & Virus Firewall at s2io.com Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - Fix a possible memory leak in vxge_hw_device_initialize(). Free hldev if vxge_hw_device_reg_addr_get() fails. Signed-off-by: Sreenivasa Honnur Signed-off-by: Ramkrishna Vepa --- -- 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 -urpN orig/drivers/net/vxge/vxge-config.c patch1/drivers/net/vxge/vxge-config.c --- orig/drivers/net/vxge/vxge-config.c 2010-04-01 12:03:33.000000000 +0530 +++ patch1/drivers/net/vxge/vxge-config.c 2010-04-01 12:05:55.000000000 +0530 @@ -634,8 +634,10 @@ vxge_hw_device_initialize( __vxge_hw_device_pci_e_init(hldev); status = __vxge_hw_device_reg_addr_get(hldev); - if (status != VXGE_HW_OK) + if (status != VXGE_HW_OK) { + vfree(hldev); goto exit; + } __vxge_hw_device_id_get(hldev); __vxge_hw_device_host_info_get(hldev);