aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-crypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-crypt.c')
-rw-r--r--drivers/md/dm-crypt.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index bfefd079a955..53394e863c74 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1156,8 +1156,7 @@ bad_ivmode:
1156 crypto_free_ablkcipher(tfm); 1156 crypto_free_ablkcipher(tfm);
1157bad_cipher: 1157bad_cipher:
1158 /* Must zero key material before freeing */ 1158 /* Must zero key material before freeing */
1159 memset(cc, 0, sizeof(*cc) + cc->key_size * sizeof(u8)); 1159 kzfree(cc);
1160 kfree(cc);
1161 return -EINVAL; 1160 return -EINVAL;
1162} 1161}
1163 1162
@@ -1183,8 +1182,7 @@ static void crypt_dtr(struct dm_target *ti)
1183 dm_put_device(ti, cc->dev); 1182 dm_put_device(ti, cc->dev);
1184 1183
1185 /* Must zero key material before freeing */ 1184 /* Must zero key material before freeing */
1186 memset(cc, 0, sizeof(*cc) + cc->key_size * sizeof(u8)); 1185 kzfree(cc);
1187 kfree(cc);
1188} 1186}
1189 1187
1190static int crypt_map(struct dm_target *ti, struct bio *bio, 1188static int crypt_map(struct dm_target *ti, struct bio *bio,