lkml.org 
[lkml]   [2010]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] arch/powerpc/platforms/83xx/mpc837x_mds.c: Add missing iounmap
From
Date

On Aug 29, 2010, at 2:47 PM, Julia Lawall wrote:

> 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>
>
> ---
> arch/powerpc/platforms/83xx/mpc837x_mds.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)

applied to merge

- k


\
 
 \ /
  Last update: 2010-08-31 23:43    [W:0.047 / U:1.880 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site