]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
crypto: padlock - Use zero page instead of stack buffer
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 15 Mar 2025 08:20:16 +0000 (16:20 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 21 Mar 2025 09:33:39 +0000 (17:33 +0800)
Use desc instead of a stack buffer in the final function.  This
fixes a compiler warning about buf being uninitialised.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/padlock-sha.c

index 6865c7f1fc1a2343611ed56fd561461bf5d7ec23..db9e84c0c9fb2bdeff72fb32dd71488673bdcba9 100644 (file)
@@ -125,7 +125,7 @@ out:
 
 static int padlock_sha1_final(struct shash_desc *desc, u8 *out)
 {
-       u8 buf[4];
+       const u8 *buf = (void *)desc;
 
        return padlock_sha1_finup(desc, buf, 0, out);
 }
@@ -186,7 +186,7 @@ out:
 
 static int padlock_sha256_final(struct shash_desc *desc, u8 *out)
 {
-       u8 buf[4];
+       const u8 *buf = (void *)desc;
 
        return padlock_sha256_finup(desc, buf, 0, out);
 }