From: Thorsten Blum Date: Tue, 17 Mar 2026 16:52:57 +0000 (+0100) Subject: crypto: marvell/cesa - use memcpy_and_pad in mv_cesa_ahash_export X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=914b0c68d4decebe52b31929f89364de32d0156e;p=thirdparty%2Fkernel%2Fstable.git crypto: marvell/cesa - use memcpy_and_pad in mv_cesa_ahash_export Replace memset() followed by memcpy() with memcpy_and_pad() to simplify the code and to write to 'cache' only once. Signed-off-by: Thorsten Blum Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/marvell/cesa/hash.c b/drivers/crypto/marvell/cesa/hash.c index 5103d36cdfdb1..2f203042d9bda 100644 --- a/drivers/crypto/marvell/cesa/hash.c +++ b/drivers/crypto/marvell/cesa/hash.c @@ -847,8 +847,7 @@ static int mv_cesa_ahash_export(struct ahash_request *req, void *hash, *len = creq->len; memcpy(hash, creq->state, digsize); - memset(cache, 0, blocksize); - memcpy(cache, creq->cache, creq->cache_ptr); + memcpy_and_pad(cache, blocksize, creq->cache, creq->cache_ptr, 0); return 0; }