]> git.ipfire.org Git - thirdparty/kernel/linux.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)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 14 Dec 2024 09:21:43 +0000 (17:21 +0800)
commite80cf84b608725303113d6fe98bb727bf7b7a40d
treeb23acc19b63b2ed7254105a55fed626dea985c87
parent5278275c1758a38199b43530adfc50098f4b41c7
crypto: qce - unregister previously registered algos in error path

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>
drivers/crypto/qce/core.c