linux/arch/alpha/kernel
Julia Lawall cc9a2c8301 arch/alpha/kernel: Add kmalloc NULL tests
Check that the result of kmalloc is not NULL before passing it to other
functions.

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

// <smpl>
@@
expression *x;
identifier f;
constant char *C;
@@

x = \(kmalloc\|kcalloc\|kzalloc\)(...);
... when != x == NULL
    when != x != NULL
    when != (x || ...)
(
kfree(x)
f(...,C,...,x,...)
|
*f(...,x,...)
|
*x->f
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2009-11-30 15:38:19 -05:00
..
.gitignore
alpha_ksyms.c
asm-offsets.c
binfmt_loader.c
console.c
core_apecs.c
core_cia.c
core_irongate.c
core_lca.c
core_marvel.c arch/alpha/kernel: Add kmalloc NULL tests 2009-11-30 15:38:19 -05:00
core_mcpcia.c
core_polaris.c
core_t2.c
core_titan.c arch/alpha/kernel: Add kmalloc NULL tests 2009-11-30 15:38:19 -05:00
core_tsunami.c
core_wildfire.c
entry.S
err_common.c
err_ev6.c
err_ev7.c
err_impl.h
err_marvel.c
err_titan.c
es1888.c
gct.c
head.S
init_task.c alpha: use .data.init_task instead of .data.init_thread. 2009-09-24 17:16:22 -07:00
io.c
irq_alpha.c
irq_i8259.c
irq_impl.h
irq_pyxis.c
irq_srm.c
irq.c
machvec_impl.h
Makefile
module.c
ns87312.c
osf_sys.c
pci_impl.h alpha: AGP update (fixes compile failure) 2009-09-24 07:21:06 -07:00
pci_iommu.c alpha: AGP update (fixes compile failure) 2009-09-24 07:21:06 -07:00
pci-noop.c
pci-sysfs.c
pci.c
process.c headers: utsname.h redux 2009-09-23 18:13:10 -07:00
proto.h
ptrace.c
setup.c
signal.c KEYS: Add missing linux/tracehook.h #inclusions 2009-09-09 18:30:02 +10:00
smc37c93x.c
smc37c669.c
smp.c cpumask: arch_send_call_function_ipi_mask: alpha 2009-09-24 09:34:43 +09:30
srm_env.c
srmcons.c
sys_alcor.c
sys_cabriolet.c
sys_dp264.c
sys_eb64p.c
sys_eiger.c
sys_jensen.c
sys_marvel.c
sys_miata.c
sys_mikasa.c
sys_nautilus.c
sys_noritake.c
sys_rawhide.c
sys_ruffian.c arch/alpha/kernel/sys_ruffian.c: Use DIV_ROUND_CLOSEST 2009-11-30 15:37:25 -05:00
sys_rx164.c
sys_sable.c
sys_sio.c
sys_sx164.c
sys_takara.c
sys_titan.c
sys_wildfire.c
systbls.S
time.c alpha: convert to use arch_gettimeoffset() 2009-09-22 07:17:43 -07:00
traps.c
vmlinux.lds.S alpha: Fix duplicate <asm/thread_info.h> include 2009-09-27 14:46:05 -07:00