Message ID | 20240929230548.370027-3-gianf.trad@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [v1] Fix NULL pointer dereference in read_cache_folio | expand |
diff --git a/mm/filemap.c b/mm/filemap.c index 4f3753f0a158..960f389e2d3b 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2360,7 +2360,10 @@ 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); - error = filler(file, folio); + if (filler) + error = filler(file, folio); + else + return -EIO; if (unlikely(workingset)) psi_memstall_leave(&pflags); if (error)