@@ -223,7 +223,7 @@ static inline struct akcipher_request *akcipher_request_alloc(
{
struct akcipher_request *req;
- req = kmalloc(sizeof(*req) + crypto_akcipher_reqsize(tfm), gfp);
+ req = kzalloc(sizeof(*req) + crypto_akcipher_reqsize(tfm), gfp);
if (likely(req))
akcipher_request_set_tfm(req, tfm);
@@ -651,7 +651,7 @@ static inline struct ahash_request *ahash_request_alloc(
{
struct ahash_request *req;
- req = kmalloc(sizeof(struct ahash_request) +
+ req = kzalloc(sizeof(struct ahash_request) +
crypto_ahash_reqsize(tfm), gfp);
if (likely(req))
@@ -201,7 +201,7 @@ static inline struct kpp_request *kpp_request_alloc(struct crypto_kpp *tfm,
{
struct kpp_request *req;
- req = kmalloc(sizeof(*req) + crypto_kpp_reqsize(tfm), gfp);
+ req = kzalloc(sizeof(*req) + crypto_kpp_reqsize(tfm), gfp);
if (likely(req))
kpp_request_set_tfm(req, tfm);
@@ -521,7 +521,7 @@ static inline struct skcipher_request *skcipher_request_alloc(
{
struct skcipher_request *req;
- req = kmalloc(sizeof(struct skcipher_request) +
+ req = kzalloc(sizeof(struct skcipher_request) +
crypto_skcipher_reqsize(tfm), gfp);
if (likely(req))
This patch is to change all req struct alloc function from kmalloc to kzalloc. Sometimes, it will incur some errors without initialized zero. Signed-off-by: Zhang Yiqun <zhangyiqun@phytium.com.cn> --- include/crypto/akcipher.h | 2 +- include/crypto/hash.h | 2 +- include/crypto/kpp.h | 2 +- include/crypto/skcipher.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)