]> Git Repo - linux.git/commitdiff
filemap: Handle error return from __filemap_get_folio()
authorMatthew Wilcox <[email protected]>
Sat, 6 May 2023 16:04:14 +0000 (17:04 +0100)
committerLinus Torvalds <[email protected]>
Sat, 6 May 2023 17:08:59 +0000 (10:08 -0700)
Smatch reports that filemap_fault() was missed in the conversion of
__filemap_get_folio() error returns from NULL to ERR_PTR.

Fixes: 66dabbb65d67 ("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]>
mm/filemap.c

index a34abfe8c65430fbded2473544ef4fffee322dd0..b4c9bd368b7e58cb904ed1c23b0e734a1a548afd 100644 (file)
@@ -3378,7 +3378,7 @@ out_retry:
         * 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);
This page took 0.05293 seconds and 4 git commands to generate.