
In get_contents function (fs/fat/fat.c), There is code that checks the return value of get_fatent() at 360th line.
355http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=fs/fat/fat.c;h=e98e50ae774bc2802d183e5888f26ec7b9b8fef1;hb=HEAD#l355 /* search for consecutive clusters */ 356http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=fs/fat/fat.c;h=e98e50ae774bc2802d183e5888f26ec7b9b8fef1;hb=HEAD#l356 while(actsize < filesize) { 357http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=fs/fat/fat.c;h=e98e50ae774bc2802d183e5888f26ec7b9b8fef1;hb=HEAD#l357 newclust = get_fatent(mydata, endclust); 358http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=fs/fat/fat.c;h=e98e50ae774bc2802d183e5888f26ec7b9b8fef1;hb=HEAD#l358 if((newclust -1)!=endclust) 359http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=fs/fat/fat.c;h=e98e50ae774bc2802d183e5888f26ec7b9b8fef1;hb=HEAD#l359 goto getit; 360http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=fs/fat/fat.c;h=e98e50ae774bc2802d183e5888f26ec7b9b8fef1;hb=HEAD#l360 if (newclust <= 0x0001 || newclust >= 0xfff0) {
I think this comparison ( >= 0xfff0 ) is only for FAT16. FAT32 value can be much larger. Is this a bug?