linux/arch/alpha
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
..
boot arch/alpha/boot/tools/objstrip.c: Mark "usage" static 2009-11-15 15:01:38 -08:00
include/asm fcntl: Use consistent values for F_[GS]ETOWN_EX 2009-11-17 09:13:43 -08:00
kernel arch/alpha/kernel: Add kmalloc NULL tests 2009-11-30 15:38:19 -05:00
lib
math-emu
mm arches: drop superfluous casts in nr_free_pages() callers 2009-09-22 07:17:34 -07:00
oprofile
defconfig
Kconfig alpha: convert to use arch_gettimeoffset() 2009-09-22 07:17:43 -07:00
Kconfig.debug
Makefile