From aaffbd9f7734721bf42d246eb31fc79d7adb2cb9 Mon Sep 17 00:00:00 2001 From: Sreenivasa Honnur Date: Thu, 8 Apr 2010 01:44:39 -0700 Subject: [PATCH] vxge: Fix a possible memory leak in vxge_hw_device_initialize(). - 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 Signed-off-by: David S. Miller --- drivers/net/vxge/vxge-config.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/vxge/vxge-config.c b/drivers/net/vxge/vxge-config.c index ec4408ceef18..66dd5893c2d3 100644 --- a/drivers/net/vxge/vxge-config.c +++ b/drivers/net/vxge/vxge-config.c @@ -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); -- 2.34.1