projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
15a9b36
)
crypto: caam - avoid kzalloc(0) in caam_read_raw_data
author
Tudor Ambarus
<tudor-dan.ambarus@nxp.com>
Tue, 25 Apr 2017 13:26:36 +0000
(16:26 +0300)
committer
Herbert Xu
<herbert@gondor.apana.org.au>
Thu, 18 May 2017 05:19:50 +0000
(13:19 +0800)
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>
drivers/crypto/caam/caampkc.c
patch
|
blob
|
history
diff --git
a/drivers/crypto/caam/caampkc.c
b/drivers/crypto/caam/caampkc.c
index
49cbdcb
..
999ba18
100644
(file)
--- a/
drivers/crypto/caam/caampkc.c
+++ b/
drivers/crypto/caam/caampkc.c
@@
-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)