block/keyslot-manager: use kvfree_sensitive()

Make blk_ksm_destroy() use the kvfree_sensitive() function (which was
introduced in v5.8-rc1) instead of open-coding it.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Eric Biggers 2020-06-16 08:56:54 -07:00 коммит произвёл Jens Axboe
Родитель bfe373f608
Коммит 3e20aa9630
1 изменённых файлов: 1 добавлений и 2 удалений

Просмотреть файл

@ -374,8 +374,7 @@ void blk_ksm_destroy(struct blk_keyslot_manager *ksm)
if (!ksm)
return;
kvfree(ksm->slot_hashtable);
memzero_explicit(ksm->slots, sizeof(ksm->slots[0]) * ksm->num_slots);
kvfree(ksm->slots);
kvfree_sensitive(ksm->slots, sizeof(ksm->slots[0]) * ksm->num_slots);
memzero_explicit(ksm, sizeof(*ksm));
}
EXPORT_SYMBOL_GPL(blk_ksm_destroy);