diff --git a/fs/squashfs/file.c b/fs/squashfs/file.c index 8ba8c4c50770..cb3753782d85 100644 --- a/fs/squashfs/file.c +++ b/fs/squashfs/file.c @@ -566,6 +566,8 @@ static void squashfs_readahead(struct readahead_control *ractl) max_pages = (expected + PAGE_SIZE - 1) >> PAGE_SHIFT; + if (!max_pages) + break; nr_pages = __readahead_batch(ractl, pages, max_pages); if (!nr_pages) break;