summaryrefslogtreecommitdiffstats
path: root/fs/fat/fat_write.c
diff options
context:
space:
mode:
authorBenoît Thébaudeau <benoit@wsystem.com>2015-09-28 15:45:30 +0200
committerTom Rini <trini@konsulko.com>2015-10-11 17:12:07 -0400
commit5e1a860e6cd6d42d9ae16c9d9abbde46514da46d (patch)
tree006bc0ed1aca156f0c2ce0aa51f6b7981c2aa68b /fs/fat/fat_write.c
parent1d7f2ece69c9d80264321bc4ee07f57eec392538 (diff)
downloadtalos-obmc-uboot-5e1a860e6cd6d42d9ae16c9d9abbde46514da46d.tar.gz
talos-obmc-uboot-5e1a860e6cd6d42d9ae16c9d9abbde46514da46d.zip
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>
Diffstat (limited to 'fs/fat/fat_write.c')
-rw-r--r--fs/fat/fat_write.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
index e08cf83b05..2399844001 100644
--- a/fs/fat/fat_write.c
+++ b/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;
}
OpenPOWER on IntegriCloud