[Drbd-dev] [PATCH 21/39] drbd: drop null test before destroy functions

Lars Ellenberg lars.ellenberg at linbit.com
Thu Sep 17 15:47:25 CEST 2015

On Sun, Sep 13, 2015 at 02:15:14PM +0200, Julia Lawall wrote:
> Remove unneeded NULL test.
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>


Just a note for our external module repo, which is supposed to be
compatible to "all" kernel versions: don't apply,
requires upstream commits
44d7175 mm/dmapool: allow NULL `pool' pointer in dma_pool_destroy()
4e3ca3e mm/mempool: allow NULL `pool' pointer in mempool_destroy()
3942d29 mm/slab_common: allow NULL cache pointer in kmem_cache_destroy()

	Lars Ellenberg

More information about the drbd-dev mailing list