fat: correct ATTR_VFAT check
PATCH 1/1 fat: correct ATTR_VFAT check
From: J. Vijayanand <[email protected]>
ATTR_VFAT condition requires multiple bits to be set but the present condition checking in do_fat_read() & get_dentfromdir() ends up passing on even a single bit being set.
Signed-off-by J. Vijayanand <[email protected]>
Signed-off-by Sergei Shtylyov <[email protected]>
--- fs/fat/fat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/fat/fat.c +3 -3
@@ -572,8 +572,8 @@ static dir_entry *get_dentfromdir (fsdat } if ((dentptr->attr & ATTR_VOLUME)) { #ifdef CONFIG_SUPPORT_VFAT - if ((dentptr->attr & ATTR_VFAT) && - (dentptr-> name[0] & LAST_LONG_ENTRY_MASK)) { + if ((dentptr->attr & ATTR_VFAT) == ATTR_VFAT && + (dentptr->name[0] & LAST_LONG_ENTRY_MASK)) { prevcksum = ((dir_slot *)dentptr)->alias_checksum; get_vfatname(mydata, curclust, get_dentfromdir_block,
@@ -897,7 +897,7 @@ do_fat_read (const char *filename, void }if ((dentptr->attr &ATTR_VOLUME )) {#ifdef CONFIG_SUPPORT_VFAT -if ((dentptr->attr &ATTR_VFAT ) && +if ((dentptr->attr &ATTR_VFAT ) ==ATTR_VFAT && (dentptr->name[0 ] &LAST_LONG_ENTRY_MASK )) { prevcksum = ((dir_slot *)dentptr)->alias_checksum;
Wolfgang Denk
AppliedPATCH 1/1 fat: correct ATTR_VFAT check
Dear Sergei Shtylyov,
Quoted 6 lines · In message <[email protected]> you wrote:
From: J. Vijayanand <[email protected]>
ATTR_VFATcondition requires multiple bits to be set but the present condition checking indo_fat_read()&get_dentfromdir()ends up passing on even a single bit being set.
Quoted 6 lines
Signed-off-by J. Vijayanand <[email protected]>Signed-off-by Sergei Shtylyov <[email protected]>--- fs/fat/fat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Defaults are wonderful, just like fire.
- Larry Wall in <[email protected]>