If key was not successfully set, return -ENOKEY instead of -EINVAL. Signed-off-by: Tudor Ambarus <tudor.ambarus@xxxxxxxxxxxxx> --- crypto/rsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/rsa.c b/crypto/rsa.c index 4c280b6..3cf640e 100644 --- a/crypto/rsa.c +++ b/crypto/rsa.c @@ -341,7 +341,7 @@ static int rsa_max_size(struct crypto_akcipher *tfm) { struct rsa_mpi_key *pkey = akcipher_tfm_ctx(tfm); - return pkey->n ? mpi_get_size(pkey->n) : -EINVAL; + return pkey->n ? mpi_get_size(pkey->n) : -ENOKEY; } static void rsa_exit_tfm(struct crypto_akcipher *tfm) -- 2.7.4