diff options
author | Gustavo A. R. Silva <gustavoars@kernel.org> | 2020-06-15 17:41:12 -0500 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2020-06-23 19:06:27 -0500 |
commit | bf1028a41eaf0ce39518cbdda34cdb717f16364a (patch) | |
tree | 51048f8904b98eb8d54af4bcaf0469117405eec7 /fs/cifs/export.c | |
parent | 5618303d8516f8ac5ecfe53ee8e8bc9a40eaf066 (diff) | |
download | linux-stable-bf1028a41eaf0ce39518cbdda34cdb717f16364a.tar.gz linux-stable-bf1028a41eaf0ce39518cbdda34cdb717f16364a.tar.bz2 linux-stable-bf1028a41eaf0ce39518cbdda34cdb717f16364a.zip |
cifs: misc: Use array_size() in if-statement controlling expression
Use array_size() instead of the open-coded version in the controlling
expression of the if statement.
Also, while there, use the preferred form for passing a size of a struct.
The alternative form where struct name is spelled out hurts readability
and introduces an opportunity for a bug when the pointer variable type is
changed but the corresponding sizeof that is passed as argument is not.
This issue was found with the help of Coccinelle and, audited and fixed
manually.
Addresses-KSPP-ID: https://github.com/KSPP/linux/issues/83
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/export.c')
0 files changed, 0 insertions, 0 deletions