fs/fat/fat_write: Fix curclust/newclust mix-up

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>
master
Benoît Thébaudeau 9 years ago committed by Tom Rini
parent 1d7f2ece69
commit 5e1a860e6c
  1. 6
      fs/fat/fat_write.c

@ -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;
}

Loading…
Cancel
Save