mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
crypto: caam - Use the preferred style for memory allocations
"The preferred form for passing a size of a struct is the following:
p = kmalloc(sizeof(*p), ...);
....
The preferred form for allocating a zeroed array is the following:
p = kcalloc(n, sizeof(...), ...); "
,so do as suggested.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Reviewed-by: Horia Geant? <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
committed by
Herbert Xu
parent
a3c09550f0
commit
9c4f9733e2
@@ -4314,7 +4314,7 @@ static struct caam_crypto_alg *caam_alg_alloc(struct caam_alg_template
|
||||
struct caam_crypto_alg *t_alg;
|
||||
struct crypto_alg *alg;
|
||||
|
||||
t_alg = kzalloc(sizeof(struct caam_crypto_alg), GFP_KERNEL);
|
||||
t_alg = kzalloc(sizeof(*t_alg), GFP_KERNEL);
|
||||
if (!t_alg) {
|
||||
pr_err("failed to allocate t_alg\n");
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
Reference in New Issue
Block a user