kernel-hacking-2024-linux-s.../arch
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
..
alpha arch/alpha/kernel: Add kmalloc NULL tests 2009-11-30 15:38:19 -05:00
arm Merge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2009-11-18 15:00:21 -08:00
avr32 at91: at91sam9g45 family: identify several chip versions 2009-11-03 18:42:31 +01:00
blackfin headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
cris
frv frv: fix check on unsigned in do_signal() 2009-10-29 07:39:32 -07:00
h8300
ia64 Revert "[IA64] fix percpu warnings" 2009-11-02 09:23:08 -08:00
m32r m32r: fix arch/m32r/boot/compressed/Makefile 2009-11-09 09:00:50 +09:00
m68k tty: Mark generic_serial users as BROKEN 2009-10-30 14:43:12 -07:00
m68knommu
microblaze microblaze: Clear sticky FSR register after saving it to func parametr 2009-10-05 11:37:47 +02:00
mips MIPS: SMTC: Fix lockup in smtc_distribute_timer 2009-11-13 18:10:38 +01:00
mn10300
parisc fcntl: Use consistent values for F_[GS]ETOWN_EX 2009-11-17 09:13:43 -08:00
powerpc Merge branch 'hostprogs-wmissing-prototypes' of git://git.kernel.org/pub/scm/linux/kernel/git/josh/linux-misc 2009-11-17 09:14:49 -08:00
s390 [S390] s390: fix single stepping on svc0 2009-11-13 15:45:03 +01:00
score
sh sh: Fixup last users of irq_chip->typename 2009-11-18 10:50:22 +09:00
sparc Merge branch 'hostprogs-wmissing-prototypes' of git://git.kernel.org/pub/scm/linux/kernel/git/josh/linux-misc 2009-11-17 09:14:49 -08:00
um headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
x86 [CPUFREQ] speedstep-ich: fix error caused by 394122ab14 2009-11-17 23:15:04 -05:00
xtensa headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
.gitignore
Kconfig