diff --git a/fs/nsfs.c b/fs/nsfs.c index c3b6ae76594a8..e9cc09583a915 100644 --- a/fs/nsfs.c +++ b/fs/nsfs.c @@ -529,8 +529,8 @@ static struct dentry *nsfs_fh_to_dentry(struct super_block *sb, struct fid *fh, /* Check that any trailing bytes are zero. */ if ((fh_len > NSFS_FID_SIZE_U32_LATEST) && - memchr_inv((void *)fid + NSFS_FID_SIZE_U32_LATEST, 0, - fh_len - NSFS_FID_SIZE_U32_LATEST)) + memchr_inv((void *)fid + NSFS_FILE_HANDLE_SIZE_LATEST, 0, + (fh_len - NSFS_FID_SIZE_U32_LATEST) * sizeof(u32))) return NULL; switch (fh_type) { @@ -624,6 +624,7 @@ static struct dentry *nsfs_fh_to_dentry(struct super_block *sb, struct fid *fh, break; #endif default: + ns->ops->put(ns); return ERR_PTR(-EOPNOTSUPP); }