Commit 5e1a860e authored by Benoît Thébaudeau's avatar Benoît Thébaudeau Committed by Tom Rini

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: default avatarBenoît Thébaudeau <benoit@wsystem.com>
parent 1d7f2ece
...@@ -721,7 +721,7 @@ set_contents(fsdata *mydata, dir_entry *dentptr, __u8 *buffer, ...@@ -721,7 +721,7 @@ set_contents(fsdata *mydata, dir_entry *dentptr, __u8 *buffer,
goto getit; goto getit;
if (CHECK_CLUST(newclust, mydata->fatsize)) { if (CHECK_CLUST(newclust, mydata->fatsize)) {
debug("curclust: 0x%x\n", newclust); debug("newclust: 0x%x\n", newclust);
debug("Invalid FAT entry\n"); debug("Invalid FAT entry\n");
return 0; return 0;
} }
...@@ -754,8 +754,8 @@ getit: ...@@ -754,8 +754,8 @@ getit:
filesize -= actsize; filesize -= actsize;
buffer += actsize; buffer += actsize;
if (CHECK_CLUST(curclust, mydata->fatsize)) { if (CHECK_CLUST(newclust, mydata->fatsize)) {
debug("curclust: 0x%x\n", curclust); debug("newclust: 0x%x\n", newclust);
debug("Invalid FAT entry\n"); debug("Invalid FAT entry\n");
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment