]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: qce - unregister previously registered algos in error path
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 3 Dec 2024 09:19:30 +0000 (10:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Feb 2025 09:05:37 +0000 (10:05 +0100)
commit76e6d50fa5a2fb466edcc8b513d7aad372312c2a
treefa2223ede472222b00413d39aad5aa1a90afa059
parentea96d8ddcf7e2a0c29d36681a726fed1b677c0ea
crypto: qce - unregister previously registered algos in error path

commit e80cf84b608725303113d6fe98bb727bf7b7a40d upstream.

If we encounter an error when registering alorithms with the crypto
framework, we just bail out and don't unregister the ones we
successfully registered in prior iterations of the loop.

Add code that goes back over the algos and unregisters them before
returning an error from qce_register_algs().

Cc: stable@vger.kernel.org
Fixes: ec8f5d8f6f76 ("crypto: qce - Qualcomm crypto engine driver")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/qce/core.c