]> git.baikalelectronics.ru Git - kernel.git/commit
arch/powerpc/platforms/83xx/mpc837x_mds.c: Add missing iounmap
authorJulia Lawall <julia@diku.dk>
Sun, 29 Aug 2010 19:47:18 +0000 (21:47 +0200)
committerKumar Gala <galak@kernel.crashing.org>
Tue, 31 Aug 2010 21:38:47 +0000 (16:38 -0500)
commit33512e5768049567a952b992fbae9e907f865a6c
tree8fece0e8803418f5c23b1861ec49b205fd02ee49
parenta30ad2bcba35d048fe1f568d625ccc7fcf184bf5
arch/powerpc/platforms/83xx/mpc837x_mds.c: Add missing iounmap

The function of_iomap returns the result of calling ioremap, so iounmap
should be called on the result in the error handling code, as done in the
normal exit of the function.

The sematic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
local idexpression x;
expression E,E1;
identifier l;
statement S;
@@

*x = of_iomap(...);
...  when != iounmap(x)
     when != if (...) { ... iounmap(x); ... }
     when != E = x
     when any
(
if (x == NULL) S
|
if (...) {
  ... when != iounmap(x)
      when != if (...) { ... iounmap(x); ... }
(
  return <+...x...+>;
|
*  return ...;
)
}
)
... when != x = E1
    when any
iounmap(x);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/platforms/83xx/mpc837x_mds.c