lkml.org 
[lkml]   [2015]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH 0/4] add NULL test
Date
Add NULL tests on various calls to kzalloc and devm_kzalloc.

The semantic match that finds these problems is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,y;
identifier fld;
@@

(
x = \(vmalloc\|kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|krealloc\|
kmemdup\|kstrdup\|
devm_kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kasprintf\|
kmalloc_array\)(...,<+... __GFP_NOFAIL ...+>,...);
|
* x = \(vmalloc\|kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|krealloc\|
kmemdup\|kstrdup\|
devm_kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kasprintf\|
kmalloc_array\)(...);
)
... when != (x) == NULL
when != (x) != NULL
when != (x) == 0
when != (x) != 0
when != x = y
(
x->fld
|
*x
|
x[...]
)
// </smpl>

---

drivers/s390/char/con3215.c | 2 ++
drivers/s390/char/raw3270.c | 2 ++
sound/soc/fsl/imx-pcm-dma.c | 2 ++
sound/soc/intel/baytrail/sst-baytrail-pcm.c | 2 ++
sound/soc/omap/omap-hdmi-audio.c | 2 ++
5 files changed, 10 insertions(+)


\
 
 \ /
  Last update: 2015-12-20 12:41    [W:0.067 / U:20.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site