Commit 20d4369b6892159895d6136946e692eaf29e8413
Committed by
David S. Miller
1 parent
83636580ad
Exists in
master
and in
6 other branches
drivers/net/ethernet/tundra/tsi108_eth.c: add missing iounmap
Add missing iounmap in error handling code, in a case where the function already preforms iounmap on some other execution path. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression e; statement S,S1; int ret; @@ e = \(ioremap\|ioremap_nocache\)(...) ... when != iounmap(e) if (<+...e...+>) S ... when any when != iounmap(e) *if (...) { ... when != iounmap(e) return ...; } ... when any iounmap(e); // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 4 additions and 2 deletions Side-by-side Diff
drivers/net/ethernet/tundra/tsi108_eth.c
... | ... | @@ -1604,7 +1604,7 @@ |
1604 | 1604 | data->phyregs = ioremap(einfo->phyregs, 0x400); |
1605 | 1605 | if (NULL == data->phyregs) { |
1606 | 1606 | err = -ENOMEM; |
1607 | - goto regs_fail; | |
1607 | + goto phyregs_fail; | |
1608 | 1608 | } |
1609 | 1609 | /* MII setup */ |
1610 | 1610 | data->mii_if.dev = dev; |
1611 | 1611 | |
... | ... | @@ -1663,8 +1663,10 @@ |
1663 | 1663 | return 0; |
1664 | 1664 | |
1665 | 1665 | register_fail: |
1666 | - iounmap(data->regs); | |
1667 | 1666 | iounmap(data->phyregs); |
1667 | + | |
1668 | +phyregs_fail: | |
1669 | + iounmap(data->regs); | |
1668 | 1670 | |
1669 | 1671 | regs_fail: |
1670 | 1672 | free_netdev(dev); |