From 5964900d2335a6d84a63e89fb0e7e302aeae4da3 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 25 Jan 2010 09:28:26 -0800 Subject: FAT: handle the cluster number being 1 Any reference to cluster 1 is an error, so treat it the same as cluster 0 or one of the EOF cluster numbers. Signed-off-by: H. Peter Anvin --- core/fs/fat/fat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/fs/fat/fat.c b/core/fs/fat/fat.c index ce3cae6a..21dda90f 100644 --- a/core/fs/fat/fat.c +++ b/core/fs/fat/fat.c @@ -128,7 +128,7 @@ static sector_t get_next_sector(struct fs_info* fs, uint32_t sector) /* get a new cluster */ cluster = get_next_cluster(fs, (data_sector >> FAT_SB(fs)->clust_shift) + 2); - if (!cluster ) + if (cluster < 2) return 0; /* return the start of the new cluster */ -- cgit v1.2.1