diff options
author | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2022-10-06 19:58:11 +0300 |
---|---|---|
committer | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2022-11-14 19:50:42 +0300 |
commit | 9144b43820610bfb69c9821c39839ffe05f2e6b2 (patch) | |
tree | 34039f5097353586bf2657c1d30d54ab26d22b76 /fs/ntfs3/namei.c | |
parent | 08811ba59a61e8147c869e2d056c37ab8ca5ebde (diff) |
fs/ntfs3: Fix sparse problems
Fixing various problems, detected by sparse.
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3/namei.c')
-rw-r--r-- | fs/ntfs3/namei.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/ntfs3/namei.c b/fs/ntfs3/namei.c index 6b0d2c01d6ff..ad6d16dec9f0 100644 --- a/fs/ntfs3/namei.c +++ b/fs/ntfs3/namei.c @@ -427,7 +427,8 @@ static int ntfs_d_compare(const struct dentry *dentry, unsigned int len1, unsigned int len2 = name->len; unsigned int lm = min(len1, len2); unsigned char c1, c2; - struct cpu_str *uni1, *uni2; + struct cpu_str *uni1; + struct le_str *uni2; /* First try fast implementation. */ for (;;) { @@ -464,8 +465,9 @@ static int ntfs_d_compare(const struct dentry *dentry, unsigned int len1, uni2 = Add2Ptr(uni1, 2048); - ret = ntfs_nls_to_utf16(sbi, name->name, name->len, uni2, NTFS_NAME_LEN, - UTF16_HOST_ENDIAN); + ret = ntfs_nls_to_utf16(sbi, name->name, name->len, + (struct cpu_str *)uni2, NTFS_NAME_LEN, + UTF16_LITTLE_ENDIAN); if (ret < 0) goto out; @@ -474,10 +476,7 @@ static int ntfs_d_compare(const struct dentry *dentry, unsigned int len1, goto out; } - ret = !ntfs_cmp_names(uni1->name, uni1->len, uni2->name, uni2->len, - sbi->upcase, false) - ? 0 - : 1; + ret = !ntfs_cmp_names_cpu(uni1, uni2, sbi->upcase, false) ? 0 : 1; out: __putname(uni1); |