]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/nfsd/nfs4xdr.c
nfsd: avoid uninitialized variable warning
[mirror_ubuntu-bionic-kernel.git] / fs / nfsd / nfs4xdr.c
index c1e92333401206dcb15a88de849de8edf75a492d..01b393501bf56612360a69b1b465e0f600beadf0 100644 (file)
@@ -2383,8 +2383,10 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp,
        __be32 status;
        int err;
        struct nfs4_acl *acl = NULL;
+#ifdef CONFIG_NFSD_V4_SECURITY_LABEL
        void *context = NULL;
        int contextlen;
+#endif
        bool contextsupport = false;
        struct nfsd4_compoundres *resp = rqstp->rq_resp;
        u32 minorversion = resp->cstate.minorversion;
@@ -2861,12 +2863,14 @@ out_acl:
                        goto out;
        }
 
+#ifdef CONFIG_NFSD_V4_SECURITY_LABEL
        if (bmval2 & FATTR4_WORD2_SECURITY_LABEL) {
                status = nfsd4_encode_security_label(xdr, rqstp, context,
                                                                contextlen);
                if (status)
                        goto out;
        }
+#endif
 
        attrlen = htonl(xdr->buf->len - attrlen_offset - 4);
        write_bytes_to_xdr_buf(xdr->buf, attrlen_offset, &attrlen, 4);