summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c
diff options
context:
space:
mode:
authorJason Wang <wangborong@cdjrlc.com>2021-08-03 20:55:25 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2021-08-12 19:16:57 +0800
commitc391714c04971f5f68e3685bd7da940c9b90036d (patch)
tree81ec72a041cc6e80bef7a833c250dab17c2346bd /drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c
parent0888d04b47a165ae8c429c6fe11b3c43f5017f31 (diff)
downloadlinux-c391714c04971f5f68e3685bd7da940c9b90036d.tar.gz
linux-c391714c04971f5f68e3685bd7da940c9b90036d.tar.bz2
linux-c391714c04971f5f68e3685bd7da940c9b90036d.zip
crypto: sun8i-ce - use kfree_sensitive to clear and free sensitive data
The kfree_sensitive is a kernel API to clear sensitive information that should not be leaked to other future users of the same memory objects and free the memory. Its function is the same as the combination of memzero_explicit and kfree. Thus, we can replace the combination APIs with the single kfree_sensitive API. Signed-off-by: Jason Wang <wangborong@cdjrlc.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c')
-rw-r--r--drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c
index 5b7af4498bd5..19cd2e52f89d 100644
--- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c
+++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c
@@ -95,9 +95,8 @@ err_pm:
memcpy(data, d, max);
err = max;
}
- memzero_explicit(d, todo);
err_dst:
- kfree(d);
+ kfree_sensitive(d);
return err;
}