• A
    nfsd: avoid uninitialized variable warning · 806e8395
    Arnd Bergmann 提交于
    [ Upstream commit 0ab88ca4bcf18ba21058d8f19220f60afe0d34d8 ]
    
    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: NArnd Bergmann <arnd@arndb.de>
    Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
    Signed-off-by: NSasha Levin <sashal@kernel.org>
    806e8395
nfs4xdr.c 115.7 KB