aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/dnet.c
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-07-28 22:27:29 +0000
committerDavid S. Miller <davem@davemloft.net>2010-07-30 23:27:58 -0700
commitde140b0d511ad86a5dd0888c9095ae030ada2e86 (patch)
tree29a2fb4db71c3ffc9ad78a9ce8e3f67d5e572600 /drivers/net/dnet.c
parentc5cb002fb0c82a0ccaef24e002ab370165b55be7 (diff)
dnet: fixup error handling in initialization
There were two problems here. We returned success if dnet_mii_init() failed and there was a release_mem_region() missing. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dnet.c')
-rw-r--r--drivers/net/dnet.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/dnet.c b/drivers/net/dnet.c
index 4ea7141f525..7c075756611 100644
--- a/drivers/net/dnet.c
+++ b/drivers/net/dnet.c
@@ -854,7 +854,7 @@ static int __devinit dnet_probe(struct platform_device *pdev)
dev = alloc_etherdev(sizeof(*bp));
if (!dev) {
dev_err(&pdev->dev, "etherdev alloc failed, aborting.\n");
- goto err_out;
+ goto err_out_release_mem;
}
/* TODO: Actually, we have some interesting features... */
@@ -911,7 +911,8 @@ static int __devinit dnet_probe(struct platform_device *pdev)
if (err)
dev_warn(&pdev->dev, "Cannot register PHY board fixup.\n");
- if (dnet_mii_init(bp) != 0)
+ err = dnet_mii_init(bp);
+ if (err)
goto err_out_unregister_netdev;
dev_info(&pdev->dev, "Dave DNET at 0x%p (0x%08x) irq %d %pM\n",
@@ -936,6 +937,8 @@ err_out_iounmap:
iounmap(bp->regs);
err_out_free_dev:
free_netdev(dev);
+err_out_release_mem:
+ release_mem_region(mem_base, mem_size);
err_out:
return err;
}