Julia Lawall 8d34e7d6f3 drivers/net/irda: Eliminate memory leak
dev_alloc_skb allocates some memory, so that memory should be freed before
leaving the function in an error case.

Corrected some typos in a nearby comment as well.

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

// <smpl>
@r exists@
local idexpression x;
expression E;
identifier f1;
iterator I;
@@

x = dev_alloc_skb(...);
<... when != x
     when != true (x == NULL || ...)
     when != if (...) { <+...x...+> }
     when != I (...) { <+...x...+> }
(
 x == NULL
|
 x == E
|
 x->f1
)
...>
* return ...;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-08-25 16:36:49 -07:00
..
2009-01-06 10:40:43 -08:00
2010-05-10 05:01:31 -07:00
2009-01-06 10:40:43 -08:00
2010-05-10 05:01:31 -07:00
2009-09-26 10:17:19 -07:00
2009-09-01 01:13:38 -07:00
2009-01-06 10:40:43 -08:00
2010-05-10 05:01:31 -07:00
2010-05-10 05:01:31 -07:00
2010-07-15 20:27:57 -07:00
2010-05-10 05:01:31 -07:00
2009-01-06 10:40:43 -08:00
2010-05-10 05:01:31 -07:00
2010-06-03 03:18:23 -07:00
2010-05-10 05:01:31 -07:00
2009-01-06 10:40:43 -08:00