MLK-21891-1 FAT: fix build error caused by cherry-pick
authorYe Li <ye.li@nxp.com>
Wed, 29 May 2019 08:40:26 +0000 (01:40 -0700)
committerYe Li <ye.li@nxp.com>
Thu, 30 May 2019 03:19:26 +0000 (20:19 -0700)
Fix issue introduced by cherry-pick patch below, the conflict
is not resolved correctly
(MLK-20668-2 fat: Fix issue in rootdir table flush for FAT16/12)

Signed-off-by: Ye Li <ye.li@nxp.com>
fs/fat/fat_write.c

index 665aa23..e2b87e3 100644 (file)
@@ -608,10 +608,10 @@ static int flush_dir_table(fat_itr *itr)
                set_fatent_value(mydata, itr->clust, dir_newclust);
                set_fatent_value(mydata, dir_newclust, 0xffffff8);
        } else {
-               dir_newclust = dir_curclust + 1;
+               dir_newclust = itr->clust + 1;
                if (dir_newclust > 1) {
                        printf("error: fail to get empty clust for directory entry\n");
-                       return;
+                       return -1;
                }
        }