Commit c530e341 authored by Horia Geantă's avatar Horia Geantă Committed by Herbert Xu

crypto: caam - fix smatch warnings

Fix the following smatch warnings:

drivers/crypto/caam/caamalg.c:2350 aead_edesc_alloc() warn: we tested 'src_nents' before and it was 'true'
drivers/crypto/caam/caamrng.c:351 caam_rng_init() error: no modifiers for allocation.
Signed-off-by: default avatarHoria Geantă <horia.geanta@nxp.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 8439e94f
...@@ -2346,10 +2346,8 @@ static struct aead_edesc *aead_edesc_alloc(struct aead_request *req, ...@@ -2346,10 +2346,8 @@ static struct aead_edesc *aead_edesc_alloc(struct aead_request *req,
/* Check if data are contiguous. */ /* Check if data are contiguous. */
all_contig = !src_nents; all_contig = !src_nents;
if (!all_contig) { if (!all_contig)
src_nents = src_nents ? : 1;
sec4_sg_len = src_nents; sec4_sg_len = src_nents;
}
sec4_sg_len += dst_nents; sec4_sg_len += dst_nents;
......
...@@ -348,7 +348,7 @@ static int __init caam_rng_init(void) ...@@ -348,7 +348,7 @@ static int __init caam_rng_init(void)
pr_err("Job Ring Device allocation for transform failed\n"); pr_err("Job Ring Device allocation for transform failed\n");
return PTR_ERR(dev); return PTR_ERR(dev);
} }
rng_ctx = kmalloc(sizeof(*rng_ctx), GFP_DMA); rng_ctx = kmalloc(sizeof(*rng_ctx), GFP_DMA | GFP_KERNEL);
if (!rng_ctx) { if (!rng_ctx) {
err = -ENOMEM; err = -ENOMEM;
goto free_caam_alloc; goto free_caam_alloc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment