xref: /utopia/UTPA2-700.0.x/projects/build/scripts/coccinelle/null/eno.cocci (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1*53ee8cc1Swenshuai.xi/// The various basic memory allocation functions don't return ERR_PTR
2*53ee8cc1Swenshuai.xi///
3*53ee8cc1Swenshuai.xi// Confidence: High
4*53ee8cc1Swenshuai.xi// Copyright: (C) 2010 Nicolas Palix, DIKU.  GPLv2.
5*53ee8cc1Swenshuai.xi// Copyright: (C) 2010 Julia Lawall, DIKU.  GPLv2.
6*53ee8cc1Swenshuai.xi// Copyright: (C) 2010 Gilles Muller, INRIA/LiP6.  GPLv2.
7*53ee8cc1Swenshuai.xi// URL: http://coccinelle.lip6.fr/
8*53ee8cc1Swenshuai.xi// Comments:
9*53ee8cc1Swenshuai.xi// Options: -no_includes -include_headers
10*53ee8cc1Swenshuai.xi
11*53ee8cc1Swenshuai.xivirtual patch
12*53ee8cc1Swenshuai.xi
13*53ee8cc1Swenshuai.xi@@
14*53ee8cc1Swenshuai.xiexpression x,E;
15*53ee8cc1Swenshuai.xi@@
16*53ee8cc1Swenshuai.xi
17*53ee8cc1Swenshuai.xix = \(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\|kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\)(...)
18*53ee8cc1Swenshuai.xi... when != x = E
19*53ee8cc1Swenshuai.xi- IS_ERR(x)
20*53ee8cc1Swenshuai.xi+ !x
21