From 57059185fb30978fea5c7eaf301d387feeaab3e1 Mon Sep 17 00:00:00 2001 From: Denis Efremov Date: Thu, 27 Aug 2020 09:43:59 +0300 Subject: [PATCH] crypto: inside-secure - use kfree_sensitive() Use kfree_sensitive() instead of open-coding it. Signed-off-by: Denis Efremov Acked-by: Antoine Tenart Signed-off-by: Herbert Xu --- drivers/crypto/inside-secure/safexcel_hash.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c index 16a467969d8e..5ffdc1cd5847 100644 --- a/drivers/crypto/inside-secure/safexcel_hash.c +++ b/drivers/crypto/inside-secure/safexcel_hash.c @@ -1082,8 +1082,7 @@ static int safexcel_hmac_init_pad(struct ahash_request *areq, } /* Avoid leaking */ - memzero_explicit(keydup, keylen); - kfree(keydup); + kfree_sensitive(keydup); if (ret) return ret;