|
@@ -783,19 +783,12 @@ static u8 *caam_read_rsa_crt(const u8 *ptr, size_t nbytes, size_t dstlen)
|
|
|
*/
|
|
|
static inline u8 *caam_read_raw_data(const u8 *buf, size_t *nbytes)
|
|
|
{
|
|
|
- u8 *val;
|
|
|
|
|
|
caam_rsa_drop_leading_zeros(&buf, nbytes);
|
|
|
if (!*nbytes)
|
|
|
return NULL;
|
|
|
|
|
|
- val = kzalloc(*nbytes, GFP_DMA | GFP_KERNEL);
|
|
|
- if (!val)
|
|
|
- return NULL;
|
|
|
-
|
|
|
- memcpy(val, buf, *nbytes);
|
|
|
-
|
|
|
- return val;
|
|
|
+ return kmemdup(buf, *nbytes, GFP_DMA | GFP_KERNEL);
|
|
|
}
|
|
|
|
|
|
static int caam_rsa_check_key_length(unsigned int len)
|