aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dnet.c
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-07-28 18:27:29 -0400
committerDavid S. Miller <davem@davemloft.net>2010-07-31 02:27:58 -0400
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 4ea7141f525d..7c075756611a 100644
--- a/drivers/net/dnet.c
+++ b/drivers/net/dnet.c
@@ -854,7 +854,7 @@ static int __devinit dnet_probe(struct platform_device *pdev)
854 dev = alloc_etherdev(sizeof(*bp)); 854 dev = alloc_etherdev(sizeof(*bp));
855 if (!dev) { 855 if (!dev) {
856 dev_err(&pdev->dev, "etherdev alloc failed, aborting.\n"); 856 dev_err(&pdev->dev, "etherdev alloc failed, aborting.\n");
857 goto err_out; 857 goto err_out_release_mem;
858 } 858 }
859 859
860 /* TODO: Actually, we have some interesting features... */ 860 /* TODO: Actually, we have some interesting features... */
@@ -911,7 +911,8 @@ static int __devinit dnet_probe(struct platform_device *pdev)
911 if (err) 911 if (err)
912 dev_warn(&pdev->dev, "Cannot register PHY board fixup.\n"); 912 dev_warn(&pdev->dev, "Cannot register PHY board fixup.\n");
913 913
914 if (dnet_mii_init(bp) != 0) 914 err = dnet_mii_init(bp);
915 if (err)
915 goto err_out_unregister_netdev; 916 goto err_out_unregister_netdev;
916 917
917 dev_info(&pdev->dev, "Dave DNET at 0x%p (0x%08x) irq %d %pM\n", 918 dev_info(&pdev->dev, "Dave DNET at 0x%p (0x%08x) irq %d %pM\n",
@@ -936,6 +937,8 @@ err_out_iounmap:
936 iounmap(bp->regs); 937 iounmap(bp->regs);
937err_out_free_dev: 938err_out_free_dev:
938 free_netdev(dev); 939 free_netdev(dev);
940err_out_release_mem:
941 release_mem_region(mem_base, mem_size);
939err_out: 942err_out:
940 return err; 943 return err;
941} 944}