Skip to content

Commit

Permalink
NFS: Always initialise fattr->label in nfs_fattr_alloc()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Trond Myklebust committed Nov 5, 2021
1 parent aa97a3e commit d4a95a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d4a95a7

Please sign in to comment.