linux/drivers/pcmcia
Julia Lawall 78a14e273d drivers/pcmcia: remove unnecessary kzalloc
The result of calling kzalloc is never used or freed.

The semantic match that finds this 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: Dominik Brodowski <linux@dominikbrodowski.net>
2009-11-22 13:03:50 +01:00
..
at91_cf.c PM / PCMCIA: Drop second argument of pcmcia_socket_dev_suspend() 2009-09-29 00:10:41 +02:00
au1000_db1x00.c pcmcia: replace remaining __FUNCTION__ occurrences 2008-05-01 08:04:00 -07:00
au1000_generic.c PM / PCMCIA: Drop second argument of pcmcia_socket_dev_suspend() 2009-09-29 00:10:41 +02:00
au1000_generic.h pcmcia: encapsulate ioaddr_t 2008-08-29 09:43:14 +02:00
au1000_pb1x00.c pcmcia: drop non-existant includes 2009-09-15 10:17:16 -07:00
au1000_xxs1500.c pcmcia: drop non-existant includes 2009-09-15 10:17:16 -07:00
bcm63xx_pcmcia.c MIPS: BCM63xx: Add PCMCIA & Cardbus support. 2009-09-30 21:47:01 +02:00
bcm63xx_pcmcia.h MIPS: BCM63xx: Add PCMCIA & Cardbus support. 2009-09-30 21:47:01 +02:00
bfin_cf_pcmcia.c PM / PCMCIA: Drop second argument of pcmcia_socket_dev_suspend() 2009-09-29 00:10:41 +02:00
cardbus.c pcmcia: use dynamic debug instead of custom infrastructure 2009-11-08 18:23:12 +01:00
cirrus.h pcmcia: drop already defined PCI_IDs 2009-10-24 17:13:01 +02:00
cistpl.c pcmcia: use dynamic debug instead of custom infrastructure 2009-11-08 18:23:12 +01:00
cs_internal.h pcmcia: use dynamic debug instead of custom infrastructure 2009-11-08 18:23:12 +01:00
cs.c pcmcia: autoload module pcmcia 2009-11-09 08:30:17 +01:00
ds.c pcmcia: remove now-defunct cs_error, pcmcia_error_{func,ret} 2009-11-09 08:30:06 +01:00
electra_cf.c powerpc: Change u64/s64 to a long long integer type 2009-01-13 14:47:59 +11:00
i82092.c PM / PCMCIA: Drop second argument of pcmcia_socket_dev_suspend() 2009-09-29 00:10:41 +02:00
i82092aa.h pcmcia: remove CVS keywords 2008-06-24 15:33:37 +02:00
i82365.c pcmcia: use dynamic debug in PCMCIA socket drivers 2009-11-08 18:23:13 +01:00
i82365.h
Kconfig PCMCIA: soc_common: convert to a stand alone module 2009-11-09 08:30:08 +01:00
m8xx_pcmcia.c pcmcia: use dynamic debug in PCMCIA socket drivers 2009-11-08 18:23:13 +01:00
m32r_cfc.c pcmcia: use dynamic debug in PCMCIA socket drivers 2009-11-08 18:23:13 +01:00
m32r_cfc.h
m32r_pcc.c pcmcia: use dynamic debug in PCMCIA socket drivers 2009-11-08 18:23:13 +01:00
m32r_pcc.h
Makefile PCMCIA: soc_common: convert to a stand alone module 2009-11-09 08:30:08 +01:00
o2micro.h pcmcia: drop already defined PCI_IDs 2009-10-24 17:13:01 +02:00
omap_cf.c PM / PCMCIA: Drop second argument of pcmcia_socket_dev_suspend() 2009-09-29 00:10:41 +02:00
pcmcia_ioctl.c pcmcia: use dynamic debug instead of custom infrastructure 2009-11-08 18:23:12 +01:00
pcmcia_resource.c pcmcia: extend error reporting and debug messages in core 2009-11-08 18:23:14 +01:00
pd6729.c pcmcia: use dev_dbg and dev_print in pd6729.c 2009-11-09 08:30:07 +01:00
pd6729.h pcmcia: use dev_dbg and dev_print in pd6729.c 2009-11-09 08:30:07 +01:00
pxa2xx_base.c PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket 2009-11-09 08:30:16 +01:00
pxa2xx_base.h PCMCIA: sa1111: wrap soc_pcmcia_socket to contain sa1111 specific data 2009-11-09 08:30:11 +01:00
pxa2xx_cm_x2xx.c [ARM] 5283/1: pxa: add CM-X255 pcmcia support 2008-10-07 12:08:02 +01:00
pxa2xx_cm_x255.c PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket 2009-11-09 08:30:16 +01:00
pxa2xx_cm_x270.c PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket 2009-11-09 08:30:16 +01:00
pxa2xx_e740.c PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket 2009-11-09 08:30:16 +01:00
pxa2xx_lubbock.c PCMCIA: sa1111: remove duplicated initializers 2009-11-09 08:30:12 +01:00
pxa2xx_mainstone.c PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket 2009-11-09 08:30:16 +01:00
pxa2xx_palmld.c PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket 2009-11-09 08:30:16 +01:00
pxa2xx_palmtc.c [ARM] pxa/palm: fix possibly uninitialized variable in PalmTC-pcmcia 2009-09-10 18:49:36 +08:00
pxa2xx_palmtx.c PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket 2009-11-09 08:30:16 +01:00
pxa2xx_sharpsl.c PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket 2009-11-09 08:30:16 +01:00
pxa2xx_stargate2.c [ARM] pxa/stargate2: add support for Compact Flash/PCMCIA 2009-06-05 10:46:32 +08:00
pxa2xx_trizeps4.c PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket 2009-11-09 08:30:16 +01:00
pxa2xx_viper.c PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket 2009-11-09 08:30:16 +01:00
ricoh.h
rsrc_mgr.c pcmcia: add new CIS access helpers 2009-11-08 18:06:54 +01:00
rsrc_nonstatic.c pcmcia: pccard_read_tuple and TUPLE_RETURN_COMMON cleanup 2009-10-19 00:29:36 +02:00
sa11xx_base.c PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket 2009-11-09 08:30:16 +01:00
sa11xx_base.h PCMCIA: sa1111: wrap soc_pcmcia_socket to contain sa1111 specific data 2009-11-09 08:30:11 +01:00
sa1100_assabet.c PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket 2009-11-09 08:30:16 +01:00
sa1100_badge4.c PCMCIA: sa1111: remove duplicated initializers 2009-11-09 08:30:12 +01:00
sa1100_cerf.c PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket 2009-11-09 08:30:16 +01:00
sa1100_generic.c PCMCIA: soc_common: push socket removal down to SoC specific support 2009-11-09 08:30:10 +01:00
sa1100_generic.h
sa1100_h3600.c PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket 2009-11-09 08:30:16 +01:00
sa1100_jornada720.c PCMCIA: sa1111: remove duplicated initializers 2009-11-09 08:30:12 +01:00
sa1100_neponset.c PCMCIA: sa1111: remove duplicated initializers 2009-11-09 08:30:12 +01:00
sa1100_shannon.c PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket 2009-11-09 08:30:16 +01:00
sa1100_simpad.c PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket 2009-11-09 08:30:16 +01:00
sa1111_generic.c drivers/pcmcia: remove unnecessary kzalloc 2009-11-22 13:03:50 +01:00
sa1111_generic.h PCMCIA: sa1111: remove duplicated initializers 2009-11-09 08:30:12 +01:00
soc_common.c PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket 2009-11-09 08:30:16 +01:00
soc_common.h PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket 2009-11-09 08:30:16 +01:00
socket_sysfs.c pcmcia: pccard_read_tuple and TUPLE_RETURN_COMMON cleanup 2009-10-19 00:29:36 +02:00
tcic.c pcmcia: use dynamic debug in PCMCIA socket drivers 2009-11-08 18:23:13 +01:00
tcic.h
ti113x.h pcmcia: use dev_printk and dev_dbg in yenta_socket 2008-08-23 01:49:44 +02:00
topic.h pcmcia: correct handling for Zoomed Video registers in topic.h 2009-11-11 19:34:27 +01:00
vg468.h
vrc4171_card.c PM / PCMCIA: Drop second argument of pcmcia_socket_dev_suspend() 2009-09-29 00:10:41 +02:00
vrc4173_cardu.c Update Yoichi Yuasa's e-mail address 2009-07-03 15:45:29 +01:00
vrc4173_cardu.h Update Yoichi Yuasa's e-mail address 2009-07-03 15:45:29 +01:00
yenta_socket.c PM / yenta: Fix cardbus suspend/resume regression 2009-09-29 00:11:03 +02:00
yenta_socket.h