summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/amcc/crypto4xx_core.c
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@googlemail.com>2017-08-25 15:47:14 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2017-09-22 17:43:15 +0800
commita728a196d253530f17da5c86dc7dfbe58c5f7094 (patch)
tree2db0f2af9730619d8f656ef35c9dafdb2f166136 /drivers/crypto/amcc/crypto4xx_core.c
parentf1f2237ff699bbc1a0265ed10407ae8d4a52008e (diff)
downloadlinux-a728a196d253530f17da5c86dc7dfbe58c5f7094.tar.bz2
crypto: crypto4xx - remove bad list_del
alg entries are only added to the list, after the registration was successful. If the registration failed, it was never added to the list in the first place. Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/amcc/crypto4xx_core.c')
-rw-r--r--drivers/crypto/amcc/crypto4xx_core.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c
index 65dc78b91dea..3118cec0d81e 100644
--- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -1033,12 +1033,10 @@ int crypto4xx_register_alg(struct crypto4xx_device *sec_dev,
break;
}
- if (rc) {
- list_del(&alg->entry);
+ if (rc)
kfree(alg);
- } else {
+ else
list_add_tail(&alg->entry, &sec_dev->alg_list);
- }
}
return 0;