Skip to content

Commit 5e0c074

Browse files
evdenisJuliaLawall
authored andcommitted
coccinelle: ifnullfree: add vfree(), kvfree*() functions
Extend the list of free functions with kvfree(), kvfree_sensitive(), vfree(). Signed-off-by: Denis Efremov <efremov@linux.com> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
1 parent a2fc371 commit 5e0c074

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎scripts/coccinelle/free/ifnullfree.cocci‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@ expression E;
2020
- if (E != NULL)
2121
(
2222
kfree(E);
23+
|
24+
kvfree(E);
2325
|
2426
kfree_sensitive(E);
27+
|
28+
kvfree_sensitive(E, ...);
29+
|
30+
vfree(E);
2531
|
2632
debugfs_remove(E);
2733
|
@@ -42,9 +48,10 @@ position p;
4248
@@
4349

4450
* if (E != NULL)
45-
* \(kfree@p\|kfree_sensitive@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|
51+
* \(kfree@p\|kvfree@p\|kfree_sensitive@p\|kvfree_sensitive@p\|vfree@p\|
52+
* debugfs_remove@p\|debugfs_remove_recursive@p\|
4653
* usb_free_urb@p\|kmem_cache_destroy@p\|mempool_destroy@p\|
47-
* dma_pool_destroy@p\)(E);
54+
* dma_pool_destroy@p\)(E, ...);
4855

4956
@script:python depends on org@
5057
p << r.p;

0 commit comments

Comments
 (0)