diff options
author | Julia Lawall <julia@diku.dk> | 2007-12-17 19:20:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-12-17 22:28:16 -0500 |
commit | 771cceb464874d4a22efd4a600e4597ad3f2fc9e (patch) | |
tree | b8e3e6392ade2ec503ab3bfa2257d6a09dbadda5 /drivers/macintosh/via-pmu.c | |
parent | d17a18dd92c91c784fcf7c785fa6bbf178fd0a6d (diff) |
drivers/macintosh/via-pmu.c: Added a missing iounmap
The error handling code should undo the ioremap as well.
The problem was detected using the following semantic match
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@@
type T,T1,T2;
identifier E;
statement S;
expression x1,x2;
constant C;
int ret;
@@
T E;
...
* E = ioremap(...);
if (E == NULL) S
... when != iounmap(E)
when != if (E != NULL) { ... iounmap(E); ...}
when != x1 = (T1)E
if (...) {
... when != iounmap(E)
when != if (E != NULL) { ... iounmap(E); ...}
when != x2 = (T2)E
(
* return;
|
* return C;
|
* return ret;
)
}
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Olaf Hering <olaf@aepfle.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/macintosh/via-pmu.c')
-rw-r--r-- | drivers/macintosh/via-pmu.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index dc741d3a4531..6123c70153d3 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c | |||
@@ -2336,6 +2336,7 @@ powerbook_sleep_3400(void) | |||
2336 | ret = pmac_suspend_devices(); | 2336 | ret = pmac_suspend_devices(); |
2337 | if (ret) { | 2337 | if (ret) { |
2338 | pbook_free_pci_save(); | 2338 | pbook_free_pci_save(); |
2339 | iounmap(mem_ctrl); | ||
2339 | printk(KERN_ERR "Sleep rejected by devices\n"); | 2340 | printk(KERN_ERR "Sleep rejected by devices\n"); |
2340 | return ret; | 2341 | return ret; |
2341 | } | 2342 | } |