[Cocci] [PATCH 2/2 v2] coccinelle: ifnullfree: handle various destroy functions

2015-10-26 Thread Julia Lawall
Extend ifnullfree to the various destroy functions that were recently
extended to tolerate NULL arguments.

Signed-off-by: Julia Lawall 

---
v2: better subject

 scripts/coccinelle/free/ifnullfree.cocci |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/scripts/coccinelle/free/ifnullfree.cocci 
b/scripts/coccinelle/free/ifnullfree.cocci
index d4a072d..52bd235 100644
--- a/scripts/coccinelle/free/ifnullfree.cocci
+++ b/scripts/coccinelle/free/ifnullfree.cocci
@@ -25,6 +25,12 @@ expression E;
   debugfs_remove_recursive(E);
 |
   usb_free_urb(E);
+|
+  kmem_cache_destroy(E);
+|
+  mempool_destroy(E);
+|
+  dma_pool_destroy(E);
 )
 
 @r depends on context || report || org @
@@ -33,7 +39,9 @@ position p;
 @@
 
 * if (E != NULL)
-*  
\(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb@p\)(E);
+*  \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|
+* usb_free_urb@p\|kmem_cache_destroy@p\|mempool_destroy@p\|
+* dma_pool_destroy@p\)(E);
 
 @script:python depends on org@
 p << r.p;

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


Re: [Cocci] [PATCH 2/2 v2] coccinelle: ifnullfree: handle various destroy functions

2015-10-26 Thread Michal Marek
Dne 26.10.2015 v 22:28 Julia Lawall napsal(a):
> Extend ifnullfree to the various destroy functions that were recently
> extended to tolerate NULL arguments.
> 
> Signed-off-by: Julia Lawall 

Applied both to kbuild.git#misc, thanks.

Michal

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci