Skip to content

Commit 9cf7928

Browse files
committed
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. Signed-off-by: Herbert Xu <[email protected]>
1 parent edc8e80 commit 9cf7928

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/crypto/padlock-sha.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static int padlock_sha1_finup(struct shash_desc *desc, const u8 *in,
125125

126126
static int padlock_sha1_final(struct shash_desc *desc, u8 *out)
127127
{
128-
u8 buf[4];
128+
const u8 *buf = (void *)desc;
129129

130130
return padlock_sha1_finup(desc, buf, 0, out);
131131
}
@@ -186,7 +186,7 @@ static int padlock_sha256_finup(struct shash_desc *desc, const u8 *in,
186186

187187
static int padlock_sha256_final(struct shash_desc *desc, u8 *out)
188188
{
189-
u8 buf[4];
189+
const u8 *buf = (void *)desc;
190190

191191
return padlock_sha256_finup(desc, buf, 0, out);
192192
}

0 commit comments

Comments
 (0)