forked from Minki/linux
crypto: caam - avoid kzalloc(0) in caam_read_raw_data
The function returns NULL if buf is composed only of zeros. Signed-off-by: Tudor Ambarus <tudor-dan.ambarus@nxp.com> Signed-off-by: Horia Geantă <horia.geanta@nxp.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
15a9b363de
commit
7fcaf62a9f
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user