summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2009-07-14 03:15:19 (GMT)
committerMike Frysinger <vapier@gentoo.org>2009-07-16 05:52:54 (GMT)
commit994e9a2e01f47f7ce24dec7edc45d70401468370 (patch)
tree897d3dbae7e2ec383e02ae6a8dfd9de2cb8ba2d8 /init
parent5bc6e3cfe6db5f33c60f042a9ba203431f334756 (diff)
downloadlinux-994e9a2e01f47f7ce24dec7edc45d70401468370.tar.xz
arch/blackfin: Add kmalloc NULL tests
Check that the result of kmalloc is not NULL before passing it to other functions. In the first two cases, the new code returns -ENOMEM, which seems compatible with what is done for similar functions for other architectures. In the last two cases, the new code fails silently, ie just returns, because the function has void return type. 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> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'init')
0 files changed, 0 insertions, 0 deletions