commit 990a8baf568ca1d0ae65e59783ff821794118d07
tree 1fe187b2f119f7a9d96d56380b211f9ddb9f8390
parent 8a5e9cf1d6626586ff08e49f400a006a9f0c3275
author Jesper Juhl <juhl-lkml@dif.dk> Tue, 21 Jun 2005 17:17:30 -0700
committer Linus Torvalds <torvalds@ppc970.osdl.org> Tue, 21 Jun 2005 19:07:48 -0700
                                                                                
    [PATCH] md: remove unneeded NULL checks before kfree
                                                                                
    This patch removes some unneeded checks of pointers being NULL before
    calling kfree() on them.  kfree() handles NULL pointers just fine, checking
    first is pointless.
                                                                                
    Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
    Signed-off-by: Andrew Morton <akpm@osdl.org>
    Signed-off-by: Linus Torvalds <torvalds@osdl.org>

[Upstream]
--- diff/drivers/md/dm-crypt.c	2005-04-04 17:37:51.000000000 +0100
+++ source/drivers/md/dm-crypt.c	2005-06-29 17:57:08.000000000 +0100
@@ -713,8 +713,7 @@
 	mempool_destroy(cc->page_pool);
 	mempool_destroy(cc->io_pool);
 
-	if (cc->iv_mode)
-		kfree(cc->iv_mode);
+	kfree(cc->iv_mode);
 	if (cc->iv_gen_ops && cc->iv_gen_ops->dtr)
 		cc->iv_gen_ops->dtr(cc);
 	crypto_free_tfm(cc->tfm);
