[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200214161147.15842-138-sashal@kernel.org>
Date: Fri, 14 Feb 2020 11:09:53 -0500
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Eric Biggers <ebiggers@...gle.com>,
Jesper Nilsson <jesper.nilsson@...s.com>,
Lars Persson <lars.persson@...s.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
Sasha Levin <sashal@...nel.org>, linux-arm-kernel@...s.com,
linux-crypto@...r.kernel.org
Subject: [PATCH AUTOSEL 4.19 138/252] crypto: artpec6 - return correct error code for failed setkey()
From: Eric Biggers <ebiggers@...gle.com>
[ Upstream commit b828f905904cd76424230c69741a4cabb0174168 ]
->setkey() is supposed to retun -EINVAL for invalid key lengths, not -1.
Fixes: a21eb94fc4d3 ("crypto: axis - add ARTPEC-6/7 crypto accelerator driver")
Cc: Jesper Nilsson <jesper.nilsson@...s.com>
Cc: Lars Persson <lars.persson@...s.com>
Signed-off-by: Eric Biggers <ebiggers@...gle.com>
Acked-by: Lars Persson <lars.persson@...s.com>
Signed-off-by: Herbert Xu <herbert@...dor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/crypto/axis/artpec6_crypto.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/axis/artpec6_crypto.c b/drivers/crypto/axis/artpec6_crypto.c
index fdcdc751d03bd..3caf57ebdbff5 100644
--- a/drivers/crypto/axis/artpec6_crypto.c
+++ b/drivers/crypto/axis/artpec6_crypto.c
@@ -1256,7 +1256,7 @@ static int artpec6_crypto_aead_set_key(struct crypto_aead *tfm, const u8 *key,
if (len != 16 && len != 24 && len != 32) {
crypto_aead_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
- return -1;
+ return -EINVAL;
}
ctx->key_length = len;
--
2.20.1
Powered by blists - more mailing lists