crypto: crypto4xx - remove bad list_del
authorChristian Lamparter <chunkeey@googlemail.com>
Fri, 25 Aug 2017 13:47:14 +0000 (15:47 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 22 Sep 2017 09:43:15 +0000 (17:43 +0800)
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>
drivers/crypto/amcc/crypto4xx_core.c

index 65dc78b91dea0147e454a5f9fdb20ed4bf024510..3118cec0d81efbf81c5cddf8d60dbff459b80940 100644 (file)
@@ -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;