* [PATCH] crypto: hisilicon - Use more common code in sec_alg_skcipher_crypto()
@ 2026-06-17 6:03 Markus Elfring
0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2026-06-17 6:03 UTC (permalink / raw)
To: linux-crypto, David S. Miller, Herbert Xu, John Garry,
Jonathan Cameron, Kees Cook, Thomas Fourier, Thorsten Blum
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 17 Jun 2026 07:51:26 +0200
Move a label so that a bit of common code can be better reused at the end
of this function implementation.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/crypto/hisilicon/sec/sec_algs.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/crypto/hisilicon/sec/sec_algs.c b/drivers/crypto/hisilicon/sec/sec_algs.c
index 85eecbb40e7e..024fe1001875 100644
--- a/drivers/crypto/hisilicon/sec/sec_algs.c
+++ b/drivers/crypto/hisilicon/sec/sec_algs.c
@@ -833,6 +833,7 @@ static int sec_alg_skcipher_crypto(struct skcipher_request *skreq,
kfree(splits_in);
kfree(splits_out_nents);
kfree(splits_out);
+err_free_split_sizes:
kfree(split_sizes);
return ret;
@@ -853,10 +854,7 @@ static int sec_alg_skcipher_crypto(struct skcipher_request *skreq,
err_unmap_in_sg:
sec_unmap_sg_on_err(skreq->src, steps, splits_in, splits_in_nents,
sec_req->len_in, info->dev);
-err_free_split_sizes:
- kfree(split_sizes);
-
- return ret;
+ goto err_free_split_sizes;
}
static int sec_alg_skcipher_encrypt(struct skcipher_request *req)
--
2.54.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-17 6:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-17 6:03 [PATCH] crypto: hisilicon - Use more common code in sec_alg_skcipher_crypto() Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®