nfsd: avoid uninitialized variable warning
authorArnd Bergmann <arnd@arndb.de>
Fri, 22 Mar 2019 14:07:11 +0000 (15:07 +0100)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 24 Apr 2019 13:46:34 +0000 (09:46 -0400)
commit0ab88ca4bcf18ba21058d8f19220f60afe0d34d8
tree8f1b86e74b3e6eca2be7a67116dfa846e7ad9f7b
parentf456458e4d25a8962d0946891617c76cc3ff5fb9
nfsd: avoid uninitialized variable warning

clang warns that 'contextlen' may be accessed without an initialization:

fs/nfsd/nfs4xdr.c:2911:9: error: variable 'contextlen' is uninitialized when used here [-Werror,-Wuninitialized]
                                                                contextlen);
                                                                ^~~~~~~~~~
fs/nfsd/nfs4xdr.c:2424:16: note: initialize the variable 'contextlen' to silence this warning
        int contextlen;
                      ^
                       = 0

Presumably this cannot happen, as FATTR4_WORD2_SECURITY_LABEL is
set if CONFIG_NFSD_V4_SECURITY_LABEL is enabled.
Adding another #ifdef like the other two in this function
avoids the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4xdr.c