diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-11-10 11:44:51 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-11-11 11:45:08 -0500 |
commit | beae2c9eb500d5509feb9fd148d34d97a9b1d276 (patch) | |
tree | 244e9a22766e79ecbbabe1debc633bcf7551c586 | |
parent | 9cdbe14fb468586454d26d7ff878e7b698449727 (diff) |
crypto: aesni: shut up -Wmaybe-uninitialized warning
The rfc4106 encrypy/decrypt helper functions cause an annoying
false-positive warning in allmodconfig if we turn on
-Wmaybe-uninitialized warnings again:
arch/x86/crypto/aesni-intel_glue.c: In function ‘helper_rfc4106_decrypt’:
include/linux/scatterlist.h:67:31: warning: ‘dst_sg_walk.sg’ may be used uninitialized in this function [-Wmaybe-uninitialized]
The problem seems to be that the compiler doesn't track the state of the
'one_entry_in_sg' variable across the kernel_fpu_begin/kernel_fpu_end
section.
This takes the easy way out by adding a bogus initialization, which
should be harmless enough to get the patch into v4.9 so we can turn on
this warning again by default without producing useless output. A
follow-up patch for v4.10 rearranges the code to make the warning go
away.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/x86/crypto/aesni-intel_glue.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c index 0ab5ee1c26af..aa8b0672f87a 100644 --- a/arch/x86/crypto/aesni-intel_glue.c +++ b/arch/x86/crypto/aesni-intel_glue.c | |||
@@ -888,7 +888,7 @@ static int helper_rfc4106_encrypt(struct aead_request *req) | |||
888 | unsigned long auth_tag_len = crypto_aead_authsize(tfm); | 888 | unsigned long auth_tag_len = crypto_aead_authsize(tfm); |
889 | u8 iv[16] __attribute__ ((__aligned__(AESNI_ALIGN))); | 889 | u8 iv[16] __attribute__ ((__aligned__(AESNI_ALIGN))); |
890 | struct scatter_walk src_sg_walk; | 890 | struct scatter_walk src_sg_walk; |
891 | struct scatter_walk dst_sg_walk; | 891 | struct scatter_walk dst_sg_walk = {}; |
892 | unsigned int i; | 892 | unsigned int i; |
893 | 893 | ||
894 | /* Assuming we are supporting rfc4106 64-bit extended */ | 894 | /* Assuming we are supporting rfc4106 64-bit extended */ |
@@ -968,7 +968,7 @@ static int helper_rfc4106_decrypt(struct aead_request *req) | |||
968 | u8 iv[16] __attribute__ ((__aligned__(AESNI_ALIGN))); | 968 | u8 iv[16] __attribute__ ((__aligned__(AESNI_ALIGN))); |
969 | u8 authTag[16]; | 969 | u8 authTag[16]; |
970 | struct scatter_walk src_sg_walk; | 970 | struct scatter_walk src_sg_walk; |
971 | struct scatter_walk dst_sg_walk; | 971 | struct scatter_walk dst_sg_walk = {}; |
972 | unsigned int i; | 972 | unsigned int i; |
973 | 973 | ||
974 | if (unlikely(req->assoclen != 16 && req->assoclen != 20)) | 974 | if (unlikely(req->assoclen != 16 && req->assoclen != 20)) |