]> git.hungrycats.org Git - linux/commitdiff
crypto: crypto4xx - remove bad list_del
authorChristian Lamparter <chunkeey@googlemail.com>
Fri, 25 Aug 2017 13:47:14 +0000 (15:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 Jul 2018 11:43:24 +0000 (13:43 +0200)
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 <chunkeey@googlemail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/amcc/crypto4xx_core.c

index e4c6c58fbb03ec66c475278adb07ff389e896599..88973df35b831922779126e7fb687436d1507b26 100644 (file)
@@ -1049,12 +1049,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;