提交 e856f3a7 编写于 作者: J Julia Lawall 提交者: Masahiro Yamada

coccinelle: devm_free: reduce false positives

Some files use both a non-devm allocation and a devm_allocation.  Don't
complain about a free when the same function contains a non-devm
allocation.
Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
上级 0a5f4176
......@@ -56,9 +56,62 @@ expression x;
x = devm_ioport_map(...)
)
@safe depends on context || org || report exists@
expression x;
position p;
@@
(
x = kmalloc(...)
|
x = kvasprintf(...)
|
x = kasprintf(...)
|
x = kzalloc(...)
|
x = kmalloc_array(...)
|
x = kcalloc(...)
|
x = kstrdup(...)
|
x = kmemdup(...)
|
x = get_free_pages(...)
|
x = request_irq(...)
|
x = ioremap(...)
|
x = ioremap_nocache(...)
|
x = ioport_map(...)
)
...
(
kfree@p(x)
|
kzfree@p(x)
|
__krealloc@p(x, ...)
|
krealloc@p(x, ...)
|
free_pages@p(x, ...)
|
free_page@p(x)
|
free_irq@p(x)
|
iounmap@p(x)
|
ioport_unmap@p(x)
)
@pb@
expression r.x;
position p;
position p != safe.p;
@@
(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册