diff options
-rw-r--r-- | fs/fat/fatent.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/fat/fatent.c b/fs/fat/fatent.c index 31f08ab62c56..67fd23744720 100644 --- a/fs/fat/fatent.c +++ b/fs/fat/fatent.c | |||
@@ -203,15 +203,18 @@ static int fat12_ent_next(struct fat_entry *fatent) | |||
203 | 203 | ||
204 | fatent->entry++; | 204 | fatent->entry++; |
205 | if (fatent->nr_bhs == 1) { | 205 | if (fatent->nr_bhs == 1) { |
206 | WARN_ON(ent12_p[0] > (u8 *)(bhs[0]->b_data + (bhs[0]->b_size - 2))); | 206 | WARN_ON(ent12_p[0] > (u8 *)(bhs[0]->b_data + |
207 | WARN_ON(ent12_p[1] > (u8 *)(bhs[0]->b_data + (bhs[0]->b_size - 1))); | 207 | (bhs[0]->b_size - 2))); |
208 | WARN_ON(ent12_p[1] > (u8 *)(bhs[0]->b_data + | ||
209 | (bhs[0]->b_size - 1))); | ||
208 | if (nextp < (u8 *)(bhs[0]->b_data + (bhs[0]->b_size - 1))) { | 210 | if (nextp < (u8 *)(bhs[0]->b_data + (bhs[0]->b_size - 1))) { |
209 | ent12_p[0] = nextp - 1; | 211 | ent12_p[0] = nextp - 1; |
210 | ent12_p[1] = nextp; | 212 | ent12_p[1] = nextp; |
211 | return 1; | 213 | return 1; |
212 | } | 214 | } |
213 | } else { | 215 | } else { |
214 | WARN_ON(ent12_p[0] != (u8 *)(bhs[0]->b_data + (bhs[0]->b_size - 1))); | 216 | WARN_ON(ent12_p[0] != (u8 *)(bhs[0]->b_data + |
217 | (bhs[0]->b_size - 1))); | ||
215 | WARN_ON(ent12_p[1] != (u8 *)bhs[1]->b_data); | 218 | WARN_ON(ent12_p[1] != (u8 *)bhs[1]->b_data); |
216 | ent12_p[0] = nextp - 1; | 219 | ent12_p[0] = nextp - 1; |
217 | ent12_p[1] = nextp; | 220 | ent12_p[1] = nextp; |
@@ -631,7 +634,6 @@ error: | |||
631 | 634 | ||
632 | return err; | 635 | return err; |
633 | } | 636 | } |
634 | |||
635 | EXPORT_SYMBOL_GPL(fat_free_clusters); | 637 | EXPORT_SYMBOL_GPL(fat_free_clusters); |
636 | 638 | ||
637 | /* 128kb is the whole sectors for FAT12 and FAT16 */ | 639 | /* 128kb is the whole sectors for FAT12 and FAT16 */ |