aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/qlcnic/qlcnic_ctx.c
diff options
context:
space:
mode:
authorAnirban Chakraborty <anirban.chakraborty@qlogic.com>2010-05-17 01:22:08 +0000
committerDavid S. Miller <davem@davemloft.net>2010-05-17 17:30:53 -0700
commitaadd8184ae4b3f0c7874929a1b0248aafc29e509 (patch)
treeeba828488d708dd7d1b8bd5eb88075f5bb1335d3 /drivers/net/qlcnic/qlcnic_ctx.c
parent0e995cd3d3c78377a0bc7d38236fc50e5438fabb (diff)
qlcnic: fix memory leaks
Fixes memory leak in error path when memory allocation for adapter data structures fails. Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_ctx.c')
-rw-r--r--drivers/net/qlcnic/qlcnic_ctx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/qlcnic/qlcnic_ctx.c b/drivers/net/qlcnic/qlcnic_ctx.c
index 0a6a39914ae..c2c1f5cc16c 100644
--- a/drivers/net/qlcnic/qlcnic_ctx.c
+++ b/drivers/net/qlcnic/qlcnic_ctx.c
@@ -421,7 +421,8 @@ int qlcnic_alloc_hw_resources(struct qlcnic_adapter *adapter)
if (addr == NULL) {
dev_err(&pdev->dev, "failed to allocate tx desc ring\n");
- return -ENOMEM;
+ err = -ENOMEM;
+ goto err_out_free;
}
tx_ring->desc_head = (struct cmd_desc_type0 *)addr;