From: Johannes Weiner <[email-masked]>

Use kzfree() instead of memset() + kfree().

Signed-off-by: Johannes Weiner <[email-masked]>
Reviewed-by: Pekka Enberg <[email-masked]>
Signed-off-by: Andrew Morton <[email-masked]>
Signed-off-by: Alasdair G Kergon <[email-masked]>
---

 drivers/md/dm-crypt.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

Index: linux-2.6.29/drivers/md/dm-crypt.c
===================================================================
--- linux-2.6.29.orig/drivers/md/dm-crypt.c	2009-04-02 16:34:52.000000000 +0100
+++ linux-2.6.29/drivers/md/dm-crypt.c	2009-04-02 16:49:32.000000000 +0100
@@ -1156,8 +1156,7 @@ bad_ivmode:
 	crypto_free_ablkcipher(tfm);
 bad_cipher:
 	/* Must zero key material before freeing */
-	memset(cc, 0, sizeof(*cc) + cc->key_size * sizeof(u8));
-	kfree(cc);
+	kzfree(cc);
 	return -EINVAL;
 }
 
@@ -1183,8 +1182,7 @@ static void crypt_dtr(struct dm_target *
 	dm_put_device(ti, cc->dev);
 
 	/* Must zero key material before freeing */
-	memset(cc, 0, sizeof(*cc) + cc->key_size * sizeof(u8));
-	kfree(cc);
+	kzfree(cc);
 }
 
 static int crypt_map(struct dm_target *ti, struct bio *bio,