OpenCloudOS-Kernel/drivers/net/wan
Julia Lawall 966a5d1b85 drivers/net/wan: introduce missing kfree
Error handling code following a kmalloc should free the allocated data.

The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
statement S;
expression E;
identifier f,f1,l;
position p1,p2;
expression *ptr != NULL;
@@

x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
     when != if (...) { <+...x...+> }
(
x->f1 = E
|
 (x->f1 == NULL || ...)
|
 f(...,x->f1,...)
)
...>
(
 return \(0\|<+...x...+>\|ptr\);
|
 return@p2 ...;
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-09-11 12:54:30 -07:00
..
lmc wan: convert drivers to netdev_tx_t 2009-09-01 01:13:28 -07:00
.gitignore
Kconfig WAN: Add IXP4xx HSS HDLC driver. 2008-12-22 00:47:31 +01:00
Makefile WAN: Add IXP4xx HSS HDLC driver. 2008-12-22 00:47:31 +01:00
c101.c WAN: Convert generic HDLC drivers to netdev_ops. 2009-01-21 14:03:37 -08:00
cosa.c wan: convert drivers to netdev_tx_t 2009-09-01 01:13:28 -07:00
cosa.h
cycx_drv.c
cycx_main.c
cycx_x25.c wan: convert drivers to netdev_tx_t 2009-09-01 01:13:28 -07:00
dlci.c wan: dlci/sdla transmit return dehacking 2009-09-07 01:56:33 -07:00
dscc4.c WAN: dscc4: Fix warning pointing out a bug. 2009-09-03 21:34:39 -07:00
farsync.c wan: convert drivers to netdev_tx_t 2009-09-01 01:13:28 -07:00
farsync.h
hd64570.c wan: convert drivers to netdev_tx_t 2009-09-01 01:13:28 -07:00
hd64570.h
hd64572.c wan: convert drivers to netdev_tx_t 2009-09-01 01:13:28 -07:00
hd64572.h
hdlc.c wan: convert drivers to netdev_tx_t 2009-09-01 01:13:28 -07:00
hdlc_cisco.c net: replace uses of __constant_{endian} 2009-02-01 00:45:17 -08:00
hdlc_fr.c wan: convert drivers to netdev_tx_t 2009-09-01 01:13:28 -07:00
hdlc_ppp.c drivers/net/wan: introduce missing kfree 2009-09-11 12:54:30 -07:00
hdlc_raw.c net: replace uses of __constant_{endian} 2009-02-01 00:45:17 -08:00
hdlc_raw_eth.c wan: convert drivers to netdev_tx_t 2009-09-01 01:13:28 -07:00
hdlc_x25.c wan: convert drivers to netdev_tx_t 2009-09-01 01:13:28 -07:00
hostess_sv11.c wan: convert drivers to netdev_tx_t 2009-09-01 01:13:28 -07:00
ixp4xx_hss.c IXP42x HSS support for setting internal clock rate 2009-09-07 01:56:49 -07:00
lapbether.c wan: convert drivers to netdev_tx_t 2009-09-01 01:13:28 -07:00
n2.c WAN: Convert generic HDLC drivers to netdev_ops. 2009-01-21 14:03:37 -08:00
pc300-falc-lh.h
pc300.h
pc300_drv.c wan/pc300_drv: convert to net_device_ops 2009-04-17 01:14:53 -07:00
pc300_tty.c
pc300too.c WAN: Convert generic HDLC drivers to netdev_ops. 2009-01-21 14:03:37 -08:00
pci200syn.c WAN: remove deprecated PCI_DEVICE_ID from PCI200SYN driver. 2009-09-07 01:56:45 -07:00
sbni.c wan: convert drivers to netdev_tx_t 2009-09-01 01:13:28 -07:00
sbni.h
sdla.c wan: dlci/sdla transmit return dehacking 2009-09-07 01:56:33 -07:00
sealevel.c wan: convert drivers to netdev_tx_t 2009-09-01 01:13:28 -07:00
wanxl.c wan: convert drivers to netdev_tx_t 2009-09-01 01:13:28 -07:00
wanxl.h
wanxlfw.S
wanxlfw.inc_shipped
x25_asy.c wan: convert drivers to netdev_tx_t 2009-09-01 01:13:28 -07:00
x25_asy.h x25_asy: convert to internal net_device_stats 2009-03-21 22:37:57 -07:00
z85230.c wan: convert drivers to netdev_tx_t 2009-09-01 01:13:28 -07:00
z85230.h wan: convert drivers to netdev_tx_t 2009-09-01 01:13:28 -07:00