Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Julia Lawall and committed by
Michal Marek
4743775c ca047e71

+9 -1
+9 -1
scripts/coccinelle/free/ifnullfree.cocci
··· 25 25 debugfs_remove_recursive(E); 26 26 | 27 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 36 @r depends on context || report || org @ ··· 39 33 @@ 40 34 41 35 * if (E != NULL) 42 - * \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb@p\)(E); 36 + * \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\| 37 + * usb_free_urb@p\|kmem_cache_destroy@p\|mempool_destroy@p\| 38 + * dma_pool_destroy@p\)(E); 43 39 44 40 @script:python depends on org@ 45 41 p << r.p;