diff mbox

crypto: sharah: Unregister correct algorithms for SAHARA 3

Message ID 91725c6a-6dc9-a503-69cf-f412b7b4cd45@fds-team.de (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

Michael Müller July 14, 2018, 10:27 p.m. UTC
This patch fixes two typos related to unregistering algorithms supported by
SAHARAH 3. In sahara_register_algs the wrong algorithms are unregistered
in case of an error. In sahara_unregister_algs the wrong array is used to
determine the iteration count.

Signed-off-by: Michael Müller <michael@fds-team.de>
---
Sorry for the duplicate email. I forgot the [PATCH] prefix, which is
automatically filtered out by the git tools that I use for other
open source projects.

 drivers/crypto/sahara.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Herbert Xu July 20, 2018, 5:55 a.m. UTC | #1
On Sun, Jul 15, 2018 at 12:27:06AM +0200, Michael Müller wrote:
> This patch fixes two typos related to unregistering algorithms supported by
> SAHARAH 3. In sahara_register_algs the wrong algorithms are unregistered
> in case of an error. In sahara_unregister_algs the wrong array is used to
> determine the iteration count.
> 
> Signed-off-by: Michael Müller <michael@fds-team.de>

Patch applied.  Thanks.
diff mbox

Patch

diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c
index 4379f016fbee..e7540a5b8197 100644
--- a/drivers/crypto/sahara.c
+++ b/drivers/crypto/sahara.c
@@ -1349,7 +1349,7 @@  static int sahara_register_algs(struct sahara_dev *dev)
 
 err_sha_v3_algs:
 	for (j = 0; j < k; j++)
-		crypto_unregister_ahash(&sha_v4_algs[j]);
+		crypto_unregister_ahash(&sha_v3_algs[j]);
 
 err_aes_algs:
 	for (j = 0; j < i; j++)
@@ -1365,7 +1365,7 @@  static void sahara_unregister_algs(struct sahara_dev *dev)
 	for (i = 0; i < ARRAY_SIZE(aes_algs); i++)
 		crypto_unregister_alg(&aes_algs[i]);
 
-	for (i = 0; i < ARRAY_SIZE(sha_v4_algs); i++)
+	for (i = 0; i < ARRAY_SIZE(sha_v3_algs); i++)
 		crypto_unregister_ahash(&sha_v3_algs[i]);
 
 	if (dev->version > SAHARA_VERSION_3)