NFS: Always initialise fattr->label in nfs_fattr_alloc()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 4 Nov 2021 22:03:26 +0000 (18:03 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 5 Nov 2021 18:54:38 +0000 (14:54 -0400)
We're about to add a check in nfs_free_fattr() for whether or not the
label is non-zero.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/inode.c

index b4cb75c45f90cf021f2ff68774ed5f11f722b996..0b5b1e44b2c4f2e7b130e174d35e5aca0c90e16b 100644 (file)
@@ -1598,8 +1598,10 @@ struct nfs_fattr *nfs_alloc_fattr(void)
        struct nfs_fattr *fattr;
 
        fattr = kmalloc(sizeof(*fattr), GFP_NOFS);
-       if (fattr != NULL)
+       if (fattr != NULL) {
                nfs_fattr_init(fattr);
+               fattr->label = NULL;
+       }
        return fattr;
 }
 EXPORT_SYMBOL_GPL(nfs_alloc_fattr);