android_kernel_xiaomi_sm8350/drivers
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
..
accessibility
acpi Merge branch 'misc' into release 2009-10-15 00:47:13 -04:00
amba
ata pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (ide) 2009-11-08 18:23:14 +01:00
atm
auxdisplay
base
block cciss: Add cciss_allow_hpsa module parameter 2009-10-13 09:18:22 +02:00
bluetooth pcmcia: deprecate CS_CHECK (bluetooth) 2009-11-08 18:23:15 +01:00
cdrom
char pcmcia: fix printk formats 2009-11-11 19:27:18 +01:00
clocksource
connector
cpufreq
cpuidle
crypto
dca
dio
dma
edac Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-10-08 12:06:36 -07:00
eisa
firewire Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2009-10-14 15:36:19 -07:00
firmware
gpio
gpu Merge branch 'drm-intel-next' of git://git.kernel.org/pub/scm/linux/kernel/git/anholt/drm-intel 2009-10-09 09:19:23 -07:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2009-10-13 10:10:33 -07:00
hwmon Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging 2009-10-11 11:23:33 -07:00
i2c
ide pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (ide) 2009-11-08 18:23:14 +01:00
idle
ieee1394 headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
ieee802154
infiniband headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
input headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
isdn pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (isdn) 2009-11-09 08:29:59 +01:00
leds
lguest headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
macintosh powerpc/pmac: Fix issues with sleep on some powerbooks 2009-10-14 16:58:35 +11:00
mca
md
media headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
memstick
message headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
mfd mfd: Fix twl4030 boot with twl4030 usb transceiver enabled 2009-10-12 15:19:23 +02:00
misc headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
mmc [ARM] pxamci: fix printing gpio numbers in pxamci_probe 2009-10-12 15:30:50 +08:00
mtd pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (misc drivers) 2009-11-09 08:30:05 +01:00
net pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (wireless) 2009-11-09 08:30:02 +01:00
nubus
of
oprofile oprofile: warn on freeing event buffer too early 2009-10-09 21:32:05 +02:00
parisc
parport pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (misc drivers) 2009-11-09 08:30:05 +01:00
pci headers: Fix build after <linux/sched.h> removal 2009-10-13 10:20:16 -07:00
pcmcia drivers/pcmcia: remove unnecessary kzalloc 2009-11-22 13:03:50 +01:00
platform Merge branch 'misc' into release 2009-10-15 00:47:13 -04:00
pnp
power
pps
ps3
rapidio
regulator
rtc headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
s390 [S390] sclp_vt220 build fix 2009-10-14 12:43:54 +02:00
sbus
scsi pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (scsi) 2009-11-09 08:30:03 +01:00
serial pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (serial_cs) 2009-11-09 08:30:04 +01:00
sfi
sh
sn
spi
ssb pcmcia: convert ssb pcmcia driver to use new CIS helpers 2009-11-08 18:23:09 +01:00
staging pcmcia/staging: update comedi drivers 2009-11-09 08:30:17 +01:00
tc
telephony pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (misc drivers) 2009-11-09 08:30:05 +01:00
thermal
uio headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
usb pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (misc drivers) 2009-11-09 08:30:05 +01:00
uwb headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
video Merge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2009-10-08 12:01:01 -07:00
virtio
vlynq
w1
watchdog watchdog: Fix rio watchdog probe function 2009-10-14 01:18:26 -07:00
xen
zorro
Kconfig
Makefile