NFS: Always initialise fattr->label in nfs_fattr_alloc()

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>
This commit is contained in:
Trond Myklebust 2021-11-04 18:03:26 -04:00
parent aa97a3ef15
commit d4a95a7e5a
1 changed files with 3 additions and 1 deletions

View 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);