Skip to content

Commit

Permalink
filemap: Handle error return from __filemap_get_folio()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reported-by: [email protected]
Reported-by: Christoph Hellwig <[email protected]>
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Matthew Wilcox authored and torvalds committed May 6, 2023
1 parent dd9e11d commit 38a55db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3378,7 +3378,7 @@ vm_fault_t filemap_fault(struct vm_fault *vmf)
* re-find the vma and come back and find our hopefully still populated
* page.
*/
if (folio)
if (!IS_ERR(folio))
folio_put(folio);
if (mapping_locked)
filemap_invalidate_unlock_shared(mapping);
Expand Down

0 comments on commit 38a55db

Please sign in to comment.