On Wed, May 15, 2019 at 02:25:45PM +0300, Iuliana Prodan wrote:
>
> @@ -1058,6 +1105,14 @@ static int __init caam_pkc_init(void)
>               goto out_put_dev;
>       }
>  
> +     /* allocate zero buffer, used for padding input */
> +     zero_buffer = kzalloc(CAAM_RSA_MAX_INPUT_SIZE - 1, GFP_DMA |
> +                           GFP_KERNEL);
> +     if (!zero_buffer) {
> +             err = -ENOMEM;
> +             goto out_put_dev;
> +     }
> +
>       err = crypto_register_akcipher(&caam_rsa);
>       if (err)
>               dev_warn(ctrldev, "%s alg registration failed\n",

This patch does not apply on top of the caam patch-series from Horia.
You're also going to leak zero_buffer if crypto_register_akcipher
fails.

Cheers,
-- 
Email: Herbert Xu <herb...@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Reply via email to