From: Tom Rini Date: Mon, 12 May 2014 21:54:36 -0400 Subject: [U-Boot] [U-Boot, 2/3] fs: fat_write: fix the incorrect last cluster checking In-Reply-To: <1399536847-21719-3-git-send-email-josh.wu@atmel.com> References: <1399536847-21719-3-git-send-email-josh.wu@atmel.com> Message-ID: <20140513015436.GL22182@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, May 08, 2014 at 04:14:06PM +0800, Wu, Josh wrote: > In fat_write.c, the last clust condition check is incorrect: > > if ((curclust >= 0xffffff8) || (curclust >= 0xfff8)) { > ... ... > } > > For example, in FAT32 if curclust is 0x11000. It is a valid clust. > But on above condition check, it will be think as a last clust. > > So the correct last clust check should be: > in fat32, curclust >= 0xffffff8 > in fat16, curclust >= 0xfff8 > in fat12, curclust >= 0xff8 > > This patch correct the last clust check. > > Signed-off-by: Josh Wu Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: