From: Wu, Josh Date: Thu, 8 May 2014 08:14:05 +0000 (+0800) Subject: fs/fat: add fat12 cluster check X-Git-Tag: v2014.07-rc2~26 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=06118973ede291df8617c4089972cbf888bdc96b;p=u-boot fs/fat: add fat12 cluster check Signed-off-by: Josh Wu --- diff --git a/include/fat.h b/include/fat.h index c8eb7ccd29..65da733aef 100644 --- a/include/fat.h +++ b/include/fat.h @@ -85,7 +85,9 @@ + (mydata->fatsize != 32 ? 0 : \ (FAT2CPU16((dent)->starthi) << 16))) #define CHECK_CLUST(x, fatsize) ((x) <= 1 || \ - (x) >= ((fatsize) != 32 ? 0xfff0 : 0xffffff0)) + (x) >= ((fatsize) != 32 ? \ + ((fatsize) != 16 ? 0xff0 : 0xfff0) : \ + 0xffffff0)) typedef struct boot_sector { __u8 ignored[3]; /* Bootstrap code */