]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
crypto: qce - fix error path in devm_qce_register_algs
authorThorsten Blum <thorsten.blum@linux.dev>
Fri, 24 Jul 2026 08:15:38 +0000 (10:15 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 30 Jul 2026 07:30:50 +0000 (17:30 +1000)
If ops->register_algs() fails, the error path repeatedly calls the same
ops->unregister_algs() from the failed registration. Use the loop index
to unregister the previously registered algorithms instead.

Fixes: e80cf84b6087 ("crypto: qce - unregister previously registered algos in error path")
Cc: stable@vger.kernel.org
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/qce/core.c

index b966f3365b7de8d2a8f6707397a34aa4facdc4ac..7f005d1fca40ecc28a1e68f4d074793f49faace8 100644 (file)
@@ -59,7 +59,7 @@ static int devm_qce_register_algs(struct qce_device *qce)
                ret = ops->register_algs(qce);
                if (ret) {
                        for (j = i - 1; j >= 0; j--)
-                               ops->unregister_algs(qce);
+                               qce_ops[j]->unregister_algs(qce);
                        return ret;
                }
        }