android_kernel_xiaomi_sm8350/arch/mips
Julia Lawall 70ebadc8e3 MIPS: TXx9: Fix error handling.
Error handling code following a kzalloc should free the allocated data.
Error handling code following an ioremap should iounmap the allocated data.

The semantic match that finds the first 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: Ralf Baechle <ralf@linux-mips.org>
2009-09-17 20:07:43 +02:00
..
alchemy MIPS: MTX-1: Request button GPIO before setting its direction 2009-08-03 17:52:46 +01:00
ar7 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-08-12 17:44:53 -07:00
basler/excite
bcm47xx
boot
cavium-octeon MIPS: Octeon: Run IPI code with interrupts disabled. 2009-08-03 17:52:47 +01:00
cobalt Update Yoichi Yuasa's e-mail address 2009-07-03 15:45:29 +01:00
configs MIPS: Add support for Texas Instruments AR7 System-on-a-Chip 2009-07-03 15:45:23 +01:00
dec MIPS: Eleminate filenames from comments 2009-08-03 17:52:40 +01:00
emma MIPS: Eleminate filenames from comments 2009-08-03 17:52:40 +01:00
fw MIPS: Eleminate filenames from comments 2009-08-03 17:52:40 +01:00
gt64120/wrppmc Update Yoichi Yuasa's e-mail address 2009-07-03 15:45:29 +01:00
include/asm MIPS: make page.h constants available to assembly. 2009-09-17 20:07:42 +02:00
jazz MIPS: Jazz: Fix read buffer overflow 2009-08-03 17:52:47 +01:00
kernel Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2009-09-15 09:39:44 -07:00
lasat
lemote/lm2e
lib MIPS: Fix __ndelay build error and add 'ull' suffix for 32-bit kernel 2009-06-17 11:06:24 +01:00
math-emu
mipssim MIPS: MIPSsim: Fix unbalance brace in mipssim get_c0_compare_int() 2009-08-03 17:52:41 +01:00
mm MIPS: Drop mmap_sem in pagefault oom path 2009-08-03 17:52:40 +01:00
mti-malta [PATCH] MIPS: SMTC: Fix compile error 2009-08-03 17:52:41 +01:00
nxp MIPS: Use DIV_ROUND_CLOSEST 2009-08-03 17:52:46 +01:00
oprofile
pci MIPS: Octeon PCIe: Make hardware and software bus numbers match. 2009-08-03 17:52:44 +01:00
pmc-sierra MIPS: Simplify and correct interrupt handling for MSP4200 2009-08-03 17:52:43 +01:00
power MIPS: Hibernation: Remove SMP TLB and cacheflushing code. 2009-06-24 18:34:39 +01:00
rb532 MIPS: RB532: Check irq number when handling GPIO interrupts 2009-06-17 11:06:27 +01:00
sgi-ip22
sgi-ip27 MIPS: Build fix - include <linux/smp.h> into all smp_processor_id() users. 2009-06-24 18:34:39 +01:00
sgi-ip32 MIPS: IP32: Remove unnecessary if not even harmful volatile keywords. 2009-05-22 13:52:06 +01:00
sibyte MIPS: Eleminate filenames from comments 2009-08-03 17:52:40 +01:00
sni MIPS: Build fix - include <linux/smp.h> into all smp_processor_id() users. 2009-06-24 18:34:39 +01:00
txx9 MIPS: TXx9: Fix error handling. 2009-09-17 20:07:43 +02:00
vr41xx Update Yoichi Yuasa's e-mail address 2009-07-03 15:45:29 +01:00
Kconfig MIPS: Allow suspend and hibernation again on uniprocessor kernels. 2009-07-03 15:45:28 +01:00
Kconfig.debug
Makefile MIPS: Add support for Texas Instruments AR7 System-on-a-Chip 2009-07-03 15:45:23 +01:00