diff options
author | J. Vijayanand <vijayanand.jayaraman@in.bosch.com> | 2011-10-19 07:43:08 +0000 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2011-10-27 23:53:57 +0200 |
commit | 206d68fdd41e4942825cfc4a91a096297b654a24 (patch) | |
tree | c1d8cabd43e514b1ca67a9febb37261ab97e2c71 /fs | |
parent | e116cc069fa4cbe51f3dab84698bc0ac57085f62 (diff) | |
download | u-boot-206d68fdd41e4942825cfc4a91a096297b654a24.tar.gz u-boot-206d68fdd41e4942825cfc4a91a096297b654a24.tar.xz u-boot-206d68fdd41e4942825cfc4a91a096297b654a24.zip |
fat: correct ATTR_VFAT check
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 <vijayanand.jayaraman@in.bosch.com>
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fat/fat.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 756ac64a8b..28baa546ab 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -572,8 +572,8 @@ static dir_entry *get_dentfromdir (fsdata *mydata, int startsect, } 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 *buffer, unsigned long maxsize, } 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; |