• Arnd Bergmann's avatar
    nfsd: avoid uninitialized variable warning · 0ab88ca4
    Arnd Bergmann authored
    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: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
    0ab88ca4
nfs4xdr.c 116 KB