Skip to contentSkip to conversation

crypto: padlock - Use zero page instead of stack buffer

PATCH New Herbert Xu 1 participant 1 message Mar 15, 2025 Crypto API

lore
Share & tools
lore

Herbert Xu

author maintainer
#0 lore raw

PATCH 1/1 crypto: padlock - Use zero page instead of stack buffer

Use desc instead of a stack buffer in the final function. This fixes a compiler warning about buf being uninitialised.

drivers/crypto/padlock-sha.c +2 -2
index 6865c7f1fc1a..db9e84c0c9fb 100644
@@ -125,7 +125,7 @@ static int padlock_sha1_finup(struct shash_desc *desc, const u8 *in,
 
 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 @@ static int padlock_sha256_finup(struct shash_desc *desc, const u8 *in,
 
 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);
 }
Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt