diff options
author | Amit Kumar Salecha <amit.salecha@qlogic.com> | 2010-06-13 23:39:03 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-15 18:15:26 -0700 |
commit | bf445080dad9542c6bc6b693d941cae89605134c (patch) | |
tree | 973dc69dee286bc97aa7f927481b3359e265c7bb /drivers/net/netxen/netxen_nic_ctx.c | |
parent | 44b496f685ca68c0d96eb3ad88e3948fad3417d6 (diff) |
netxen: fix memory leaks in error path
Fixes memory leak in error path when memory allocation
for adapter data structures fails.
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_ctx.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_ctx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/netxen/netxen_nic_ctx.c b/drivers/net/netxen/netxen_nic_ctx.c index f26e54716c8..3a41b6a84a6 100644 --- a/drivers/net/netxen/netxen_nic_ctx.c +++ b/drivers/net/netxen/netxen_nic_ctx.c @@ -629,7 +629,8 @@ int netxen_alloc_hw_resources(struct netxen_adapter *adapter) if (addr == NULL) { dev_err(&pdev->dev, "%s: failed to allocate tx desc ring\n", netdev->name); - return -ENOMEM; + err = -ENOMEM; + goto err_out_free; } tx_ring->desc_head = (struct cmd_desc_type0 *)addr; |