crypto: virtio - Less function calls in __virtio_crypto_akcipher_do_req() after error...
authorMarkus Elfring <elfring@users.sourceforge.net>
Tue, 26 Dec 2023 10:00:20 +0000 (11:00 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 26 Jan 2024 08:36:57 +0000 (16:36 +0800)
commite01966e643c97eb8916bbbbbeceb687afb11f345
tree5421bb4e9e476df82a1dae5bf8958b2f9ad03774
parentc5a2f74db71a849f3a60bc153d684d6d28a0c665
crypto: virtio - Less function calls in __virtio_crypto_akcipher_do_req() after error detection

The kfree() function was called in up to two cases by the
__virtio_crypto_akcipher_do_req() function during error handling
even if the passed variable contained a null pointer.
This issue was detected by using the Coccinelle software.

* Adjust jump targets.

* Delete two initialisations which became unnecessary
  with this refactoring.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Justin Stitt <justinstitt@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/virtio/virtio_crypto_akcipher_algs.c