diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c index 1122bee3b63444ae10d5cdd6aa10b11927d27e7b..158427e8124e116b12a5b9439dc84ba256d138ea 100644 --- a/fs/exfat/dir.c +++ b/fs/exfat/dir.c @@ -100,7 +100,7 @@ static int exfat_readdir(struct inode *inode, loff_t *cpos, struct exfat_dir_ent clu.dir = ei->hint_bmap.clu; } - while (clu_offset > 0) { + while (clu_offset > 0 && clu.dir != EXFAT_EOF_CLUSTER) { if (exfat_get_next_cluster(sb, &(clu.dir))) return -EIO;