Julia Lawall c4a3987fa0 drivers/serial/sunsu.c: Correct use after free
The of_iounmap is at the out_unmap label, but at that point up has already
been freed.  The free cannot be moved to the out_unmap label, because that
label is reachable from cases where up should not be freed.  So the call to
of_iounmap is just duplicated, and the goto converted to a return.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,e;
identifier f;
iterator I;
statement S;
@@

*kfree(x);
... when != &x
    when != x = e
    when != I(x,...) S
*x->f
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-29 22:33:28 -07:00
..
2009-12-11 15:18:03 -08:00
2010-02-27 12:52:57 +01:00
2010-01-20 15:03:30 -08:00
2009-12-15 08:53:27 -08:00
2010-02-27 18:31:02 +01:00
2010-02-27 18:31:02 +01:00
2010-02-27 18:31:02 +01:00
2009-12-15 08:53:25 -08:00