Skip to content

Commit 38a55db

Browse files
Matthew Wilcoxtorvalds
authored andcommitted
filemap: Handle error return from __filemap_get_folio()
Smatch reports that filemap_fault() was missed in the conversion of __filemap_get_folio() error returns from NULL to ERR_PTR. Fixes: 66dabbb ("mm: return an ERR_PTR from __filemap_get_folio") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Reported-by: syzbot+48011b86c8ea329af1b9@syzkaller.appspotmail.com Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent dd9e11d commit 38a55db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/filemap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3378,7 +3378,7 @@ vm_fault_t filemap_fault(struct vm_fault *vmf)
33783378
* re-find the vma and come back and find our hopefully still populated
33793379
* page.
33803380
*/
3381-
if (folio)
3381+
if (!IS_ERR(folio))
33823382
folio_put(folio);
33833383
if (mapping_locked)
33843384
filemap_invalidate_unlock_shared(mapping);

0 commit comments

Comments
 (0)