8df0937e4d5676a1cd2e2d767627e21b0008fe1a
[openwrt/openwrt.git] / target / linux / apm821xx / patches-4.14 / 020-0001-crypto-crypto4xx-remove-bad-list_del.patch
1 From a728a196d253530f17da5c86dc7dfbe58c5f7094 Mon Sep 17 00:00:00 2001
2 From: Christian Lamparter <chunkeey@googlemail.com>
3 Date: Fri, 25 Aug 2017 15:47:14 +0200
4 Subject: [PATCH 01/25] crypto: crypto4xx - remove bad list_del
5
6 alg entries are only added to the list, after the registration
7 was successful. If the registration failed, it was never added
8 to the list in the first place.
9
10 Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
12 ---
13 drivers/crypto/amcc/crypto4xx_core.c | 6 ++----
14 1 file changed, 2 insertions(+), 4 deletions(-)
15
16 --- a/drivers/crypto/amcc/crypto4xx_core.c
17 +++ b/drivers/crypto/amcc/crypto4xx_core.c
18 @@ -1033,12 +1033,10 @@ int crypto4xx_register_alg(struct crypto
19 break;
20 }
21
22 - if (rc) {
23 - list_del(&alg->entry);
24 + if (rc)
25 kfree(alg);
26 - } else {
27 + else
28 list_add_tail(&alg->entry, &sec_dev->alg_list);
29 - }
30 }
31
32 return 0;