Merge tag 'u-boot-atmel-fixes-2021.01-b' of https://gitlab.denx.de/u-boot/custodians...
[platform/kernel/u-boot.git] / fs / fat / fat.c
index 7fd2947..fb6ba89 100644 (file)
@@ -278,7 +278,10 @@ get_cluster(fsdata *mydata, __u32 clustnum, __u8 *buffer, unsigned long size)
                }
        } else {
                idx = size / mydata->sect_size;
-               ret = disk_read(startsect, idx, buffer);
+               if (idx == 0)
+                       ret = 0;
+               else
+                       ret = disk_read(startsect, idx, buffer);
                if (ret != idx) {
                        debug("Error reading data (got %d)\n", ret);
                        return -1;
@@ -923,8 +926,7 @@ static int fat_itr_next(fat_itr *itr)
                if (!dent)
                        return 0;
 
-               if (dent->name[0] == DELETED_FLAG ||
-                   dent->name[0] == aRING)
+               if (dent->name[0] == DELETED_FLAG)
                        continue;
 
                if (dent->attr & ATTR_VOLUME) {
@@ -949,9 +951,7 @@ static int fat_itr_next(fat_itr *itr)
                                /* Volume label or VFAT entry, skip */
                                continue;
                        }
-               } else if (!(dent->attr & ATTR_ARCH) &&
-                          !(dent->attr & ATTR_DIR))
-                       continue;
+               }
 
                /* short file name */
                break;