Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tls: Avoid -Wflex-array-member-not-at-end warning

Remove unused flexible-array member in struct tls_rec and, with this,
fix the following warning:

net/tls/tls.h:131:29: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

Also, add a comment to prevent people from adding any members
after struct aead_request, which is a flexible structure --this is
a structure that ends in a flexible-array member.

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://patch.msgid.link/aNMG1lyXw4XEAVaE@kspp
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Gustavo A. R. Silva and committed by
Jakub Kicinski
b6db19d1 5e3fee34

+2 -1
+2 -1
net/tls/tls.h
··· 128 128 129 129 char aad_space[TLS_AAD_SPACE_SIZE]; 130 130 u8 iv_data[TLS_MAX_IV_SIZE]; 131 + 132 + /* Must be last --ends in a flexible-array member. */ 131 133 struct aead_request aead_req; 132 - u8 aead_req_ctx[]; 133 134 }; 134 135 135 136 int __net_init tls_proc_init(struct net *net);