diff --git a/mm/filemap.c b/mm/filemap.c index 4f3753f0a158..88de8029133c 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2360,6 +2360,8 @@ static int filemap_read_folio(struct file *file, filler_t filler, /* Start the actual read. The read will unlock the page. */ if (unlikely(workingset)) psi_memstall_enter(&pflags); + if (!filler) + return -EIO; error = filler(file, folio); if (unlikely(workingset)) psi_memstall_leave(&pflags);