提交 7fcaf62a 编写于 作者: T Tudor Ambarus 提交者: Herbert Xu

crypto: caam - avoid kzalloc(0) in caam_read_raw_data

The function returns NULL if buf is composed only of zeros.
Signed-off-by: NTudor Ambarus <tudor-dan.ambarus@nxp.com>
Signed-off-by: NHoria Geantă <horia.geanta@nxp.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 15a9b363
......@@ -374,6 +374,8 @@ static inline u8 *caam_read_raw_data(const u8 *buf, size_t *nbytes)
buf++;
(*nbytes)--;
}
if (!*nbytes)
return NULL;
val = kzalloc(*nbytes, GFP_DMA | GFP_KERNEL);
if (!val)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册