]> git.sur5r.net Git - u-boot/commitdiff
fs/fat/fat_write: Fix curclust/newclust mix-up
authorBenoît Thébaudeau <benoit@wsystem.com>
Mon, 28 Sep 2015 13:45:30 +0000 (15:45 +0200)
committerTom Rini <trini@konsulko.com>
Sun, 11 Oct 2015 21:12:07 +0000 (17:12 -0400)
curclust was used instead of newclust in the debug() calls and in one
CHECK_CLUST() call, which could skip a failure case.

Signed-off-by: Benoît Thébaudeau <benoit@wsystem.com>
fs/fat/fat_write.c

index e08cf83b05352ef5dc1cf57033815cdfdbc1c0d1..239984400174ff7077332b8d261dcca88a1718e8 100644 (file)
@@ -721,7 +721,7 @@ set_contents(fsdata *mydata, dir_entry *dentptr, __u8 *buffer,
                                goto getit;
 
                        if (CHECK_CLUST(newclust, mydata->fatsize)) {
-                               debug("curclust: 0x%x\n", newclust);
+                               debug("newclust: 0x%x\n", newclust);
                                debug("Invalid FAT entry\n");
                                return 0;
                        }
@@ -754,8 +754,8 @@ getit:
                filesize -= actsize;
                buffer += actsize;
 
-               if (CHECK_CLUST(curclust, mydata->fatsize)) {
-                       debug("curclust: 0x%x\n", curclust);
+               if (CHECK_CLUST(newclust, mydata->fatsize)) {
+                       debug("newclust: 0x%x\n", newclust);
                        debug("Invalid FAT entry\n");
                        return 0;
                }