mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
dm crypt: use kzfree
Use kzfree() instead of memset() + kfree(). Signed-off-by: Johannes Weiner <[email protected]> Reviewed-by: Pekka Enberg <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
This commit is contained in:
parent
45194e4f89
commit
b81d6cf79b
1 changed files with 2 additions and 4 deletions
|
|
@ -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 *ti)
|
|||
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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue