aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2013-09-02 05:54:21 -0400
committerDavid S. Miller <davem@davemloft.net>2013-09-04 13:18:19 -0400
commit0a171933a4b5d6706b782271ac68462c97c1ac50 (patch)
tree8bf6670ed564e1331855a1096679887981ee0f15 /drivers/net
parentcfd280c91253cc28e4919e349fa7a813b63e71e8 (diff)
drivers:net: delete premature free_irq
Free_irq is not needed if there has been no request_irq. Free_irq is removed from both the probe and remove functions. The correct request_irq and free_irq are found in the open and close functions. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression e; @@ *e = platform_get_irq(...); ... when != request_irq(e,...) *free_irq(e,...) // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/nuvoton/w90p910_ether.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/net/ethernet/nuvoton/w90p910_ether.c b/drivers/net/ethernet/nuvoton/w90p910_ether.c
index dcfe58fa3b8a..79645f74b3a8 100644
--- a/drivers/net/ethernet/nuvoton/w90p910_ether.c
+++ b/drivers/net/ethernet/nuvoton/w90p910_ether.c
@@ -1014,7 +1014,7 @@ static int w90p910_ether_probe(struct platform_device *pdev)
1014 if (ether->rxirq < 0) { 1014 if (ether->rxirq < 0) {
1015 dev_err(&pdev->dev, "failed to get ether rx irq\n"); 1015 dev_err(&pdev->dev, "failed to get ether rx irq\n");
1016 error = -ENXIO; 1016 error = -ENXIO;
1017 goto failed_free_txirq; 1017 goto failed_free_io;
1018 } 1018 }
1019 1019
1020 platform_set_drvdata(pdev, dev); 1020 platform_set_drvdata(pdev, dev);
@@ -1023,7 +1023,7 @@ static int w90p910_ether_probe(struct platform_device *pdev)
1023 if (IS_ERR(ether->clk)) { 1023 if (IS_ERR(ether->clk)) {
1024 dev_err(&pdev->dev, "failed to get ether clock\n"); 1024 dev_err(&pdev->dev, "failed to get ether clock\n");
1025 error = PTR_ERR(ether->clk); 1025 error = PTR_ERR(ether->clk);
1026 goto failed_free_rxirq; 1026 goto failed_free_io;
1027 } 1027 }
1028 1028
1029 ether->rmiiclk = clk_get(&pdev->dev, "RMII"); 1029 ether->rmiiclk = clk_get(&pdev->dev, "RMII");
@@ -1049,10 +1049,6 @@ failed_put_rmiiclk:
1049 clk_put(ether->rmiiclk); 1049 clk_put(ether->rmiiclk);
1050failed_put_clk: 1050failed_put_clk:
1051 clk_put(ether->clk); 1051 clk_put(ether->clk);
1052failed_free_rxirq:
1053 free_irq(ether->rxirq, pdev);
1054failed_free_txirq:
1055 free_irq(ether->txirq, pdev);
1056failed_free_io: 1052failed_free_io:
1057 iounmap(ether->reg); 1053 iounmap(ether->reg);
1058failed_free_mem: 1054failed_free_mem:
@@ -1075,9 +1071,6 @@ static int w90p910_ether_remove(struct platform_device *pdev)
1075 iounmap(ether->reg); 1071 iounmap(ether->reg);
1076 release_mem_region(ether->res->start, resource_size(ether->res)); 1072 release_mem_region(ether->res->start, resource_size(ether->res));
1077 1073
1078 free_irq(ether->txirq, dev);
1079 free_irq(ether->rxirq, dev);
1080
1081 del_timer_sync(&ether->check_timer); 1074 del_timer_sync(&ether->check_timer);
1082 1075
1083 free_netdev(dev); 1076 free_netdev(dev);