Skip to content

Commit

Permalink
coccinelle: ifnullfree: handle various destroy functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Julia Lawall authored and Michal Marek committed Oct 26, 2015
1 parent ca047e7 commit 4743775
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/coccinelle/free/ifnullfree.cocci
Original file line number Diff line number Diff line change
Expand Up @@ -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 @
Expand All @@ -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;
Expand Down

0 comments on commit 4743775

Please sign in to comment.