diff mbox

[01/12] crypto: crypto4xx: remove bad list_del

Message ID 71020bd2e3f4100c3c0668a13fdad9d22c8884a7.1503668705.git.chunkeey@googlemail.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

Christian Lamparter Aug. 25, 2017, 1:47 p.m. UTC
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>
---
 drivers/crypto/amcc/crypto4xx_core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Herbert Xu Sept. 22, 2017, 10:14 a.m. UTC | #1
On Fri, Aug 25, 2017 at 03:47:14PM +0200, Christian Lamparter wrote:
> 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>

All applied.  Thanks.
diff mbox

Patch

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;