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>
This commit is contained in:
Christian Lamparter 2017-08-25 15:47:14 +02:00 committed by Herbert Xu
parent f1f2237ff6
commit a728a196d2
1 changed files with 2 additions and 4 deletions

View File

@ -1033,13 +1033,11 @@ 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;
}