linux/drivers/net/irda
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
..
act200l-sir.c
actisys-sir.c
ali-ircc.c
ali-ircc.h
au1k_ir.c
au1000_ircc.h
bfin_sir.c
bfin_sir.h
donauboe.c
donauboe.h
ep7211-sir.c
esi-sir.c
girbil-sir.c
irda-usb.c
irda-usb.h
irtty-sir.c
irtty-sir.h
Kconfig
kingsun-sir.c
ks959-sir.c
ksdazzle-sir.c
litelink-sir.c
ma600-sir.c
Makefile
mcp2120-sir.c
mcs7780.c drivers/net/irda: Adjust confusing if indentation 2010-08-16 21:06:26 -07:00
mcs7780.h
nsc-ircc.c
nsc-ircc.h
old_belkin-sir.c
pxaficp_ir.c
sa1100_ir.c
sh_irda.c Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/genesis-2.6 into devel-stable 2010-08-06 18:13:19 +01:00
sh_sir.c
sir_dev.c
sir_dongle.c
sir-dev.h
smsc-ircc2.c drivers/net/irda: use for_each_pci_dev() 2010-07-21 14:44:28 -07:00
smsc-ircc2.h
smsc-sio.h
stir4200.c
tekram-sir.c
toim3232-sir.c
via-ircc.c drivers/net/irda: Eliminate memory leak 2010-08-25 16:36:49 -07:00
via-ircc.h
vlsi_ir.c
vlsi_ir.h
w83977af_ir.c
w83977af_ir.h
w83977af.h