The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] crypto: qce - fix error path in devm_qce_register_algs
@ 2026-07-24  8:15 Thorsten Blum
  2026-07-24 10:21 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-07-24  8:15 UTC (permalink / raw)
  To: Bartosz Golaszewski, Herbert Xu, David S. Miller, Neil Armstrong
  Cc: Thorsten Blum, stable, linux-crypto, linux-arm-msm, linux-kernel

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>
---
 drivers/crypto/qce/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c
index ac74f69914d6..ea5b9689ce68 100644
--- a/drivers/crypto/qce/core.c
+++ b/drivers/crypto/qce/core.c
@@ -58,7 +58,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;
 		}
 	}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: qce - fix error path in devm_qce_register_algs
  2026-07-24  8:15 [PATCH] crypto: qce - fix error path in devm_qce_register_algs Thorsten Blum
@ 2026-07-24 10:21 ` Bartosz Golaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2026-07-24 10:21 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: stable, linux-crypto, linux-arm-msm, linux-kernel,
	Bartosz Golaszewski, Herbert Xu, David S. Miller, Neil Armstrong

On Fri, 24 Jul 2026 10:15:38 +0200, Thorsten Blum
<thorsten.blum@linux.dev> said:
> 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>
> ---
>  drivers/crypto/qce/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c
> index ac74f69914d6..ea5b9689ce68 100644
> --- a/drivers/crypto/qce/core.c
> +++ b/drivers/crypto/qce/core.c
> @@ -58,7 +58,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;
>  		}
>  	}
>

Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-24 10:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-24  8:15 [PATCH] crypto: qce - fix error path in devm_qce_register_algs Thorsten Blum
2026-07-24 10:21 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox