From: Christian Lamparter Date: Fri, 25 Aug 2017 13:47:14 +0000 (+0200) Subject: crypto: crypto4xx - remove bad list_del X-Git-Tag: v4.9.114~52 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af4b765a780b71f8d823bfd9123bd101fd12eb03;p=platform%2Fkernel%2Flinux-amlogic.git crypto: crypto4xx - remove bad list_del commit a728a196d253530f17da5c86dc7dfbe58c5f7094 upstream. 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 Signed-off-by: Herbert Xu Signed-off-by: Amit Pundir Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c index dae1e39139e9..ba80e8a5d73b 100644 --- a/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c @@ -1034,12 +1034,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;