fs/ntfs3: Uninitialized variable bug in ntfs_d_compare()
Subsystems (2)
PATCH 1/1 fs/ntfs3: Uninitialized variable bug in ntfs_d_compare()
Smatch detected an uninitialized variable bug:
fs/ntfs3/namei.c:487 ntfs_d_compare() error: uninitialized symbol 'uni1'
Fixes a3a956c78efa ("fs/ntfs3: Add option "nocase"")
Signed-off-by Dan Carpenter <[email protected]>
--- fs/ntfs3/namei.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
fs/ntfs3/namei.c +4 -8
@@ -431,10 +431,8 @@ static int ntfs_d_compare(const struct dentry *dentry, unsigned int len1,/* First try fast implementation. */ for (;;) { -if (!lm--) { - ret = len1 == len2 ?0 :1 ; - goto out; - } +if (!lm--) +return len1 == len2 ?0 :1 ;if ((c1 = *n1++) == (c2 = *n2++))continue ;
@@ -442,10 +440,8 @@ static int ntfs_d_compare(const struct dentry *dentry, unsigned int len1,if (c1 >=0x80 || c2 >=0x80 )break ; -if (toupper (c1) !=toupper (c2)) { - ret =1 ; - goto out; - } +if (toupper (c1) !=toupper (c2)) +return 1 ; }/*
Signature · 1 line
2.35.1
Konstantin Komarov
maintainerQuoted 30 lines · Dan Carpenter
Smatch detected an uninitialized variable bug:
fs/ntfs3/namei.c:487ntfs_d_compare()error: uninitialized symbol 'uni1'Fixes a3a956c78efa ("fs/ntfs3: Add option "nocase"")Signed-off-by Dan Carpenter <[email protected]>--- fs/ntfs3/namei.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)fs/ntfs3/namei.c +2
-4@@ -431,10 +431,8 @@ static int ntfs_d_compare(const struct dentry *dentry, unsigned int len1,/* First try fast implementation. */ for (;;) { -if (!lm--) { - ret = len1 == len2 ?0 :1 ; - goto out; - } +if (!lm--) +return len1 == len2 ?0 :1 ;if ((c1 = *n1++) == (c2 = *n2++))continue ;@@ -442,10 +440,8 @@ static int ntfs_d_compare(const struct dentry *dentry, unsigned int len1,if (c1 >=0x80 || c2 >=0x80 )break ;
fs/ntfs3/namei.c static int ntfs_d_compare(const struct dentry *dentry, unsigned int len1, · line 447
Quoted 10 lines
fs/ntfs3/namei.c +2
-4-if (toupper (c1) !=toupper (c2)) { - ret =1 ; - goto out; - } +if (toupper (c1) !=toupper (c2)) +return 1 ; }/*
Thanks for work, this bug has already been fixed: