From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Mon, 28 Sep 2015 15:45:30 +0200 Subject: [U-Boot] [PATCH 3/5] fs/fat/fat_write: Fix curclust/newclust mix-up In-Reply-To: <1443447932-14139-1-git-send-email-benoit@wsystem.com> References: <807994631.1713509.1365795559751.JavaMail.root@advansee.com> <1443447932-14139-1-git-send-email-benoit@wsystem.com> Message-ID: <1443447932-14139-3-git-send-email-benoit@wsystem.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- fs/fat/fat_write.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c index e08cf83..2399844 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; } -- 2.1.4