aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2015-10-26 17:28:26 -0400
committerMichal Marek <mmarek@suse.cz>2015-10-26 17:41:18 -0400
commit4743775c6de44b3c36e15bcab2dee928b6361a16 (patch)
tree5bf2da40ed2744dae5bee547edcbefbd9899d23c /scripts
parentca047e715c638eacf58cb830c3ef36cecc45c3f8 (diff)
coccinelle: ifnullfree: handle various destroy functions
Extend ifnullfree to the various destroy functions that were recently extended to tolerate NULL arguments. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/coccinelle/free/ifnullfree.cocci10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/coccinelle/free/ifnullfree.cocci b/scripts/coccinelle/free/ifnullfree.cocci
index d4a072d5b505..52bd235286fa 100644
--- a/scripts/coccinelle/free/ifnullfree.cocci
+++ b/scripts/coccinelle/free/ifnullfree.cocci
@@ -25,6 +25,12 @@ expression E;
25 debugfs_remove_recursive(E); 25 debugfs_remove_recursive(E);
26| 26|
27 usb_free_urb(E); 27 usb_free_urb(E);
28|
29 kmem_cache_destroy(E);
30|
31 mempool_destroy(E);
32|
33 dma_pool_destroy(E);
28) 34)
29 35
30@r depends on context || report || org @ 36@r depends on context || report || org @
@@ -33,7 +39,9 @@ position p;
33@@ 39@@
34 40
35* if (E != NULL) 41* if (E != NULL)
36* \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb@p\)(E); 42* \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|
43* usb_free_urb@p\|kmem_cache_destroy@p\|mempool_destroy@p\|
44* dma_pool_destroy@p\)(E);
37 45
38@script:python depends on org@ 46@script:python depends on org@
39p << r.p; 47p << r.p;