]> Git Repo - linux.git/commitdiff
nfs: fix another case of NULL/IS_ERR confusion wrt folio pointers
authorLinus Torvalds <[email protected]>
Tue, 9 May 2023 17:22:13 +0000 (10:22 -0700)
committerLinus Torvalds <[email protected]>
Tue, 9 May 2023 17:22:13 +0000 (10:22 -0700)
Dan has been improving on the smatch error pointer checks, and pointed
at another case where the __filemap_get_folio() conversion to error
pointers had been overlooked.  This time because it was hidden behind
the filemap_grab_folio() helper function that is a wrapper around it.

Reported-by: Dan Carpenter <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/nfs/dir.c

index bacad0c57810487f47138a11ffcfc43a043fb4d6..e63c1d46f189acd0525271f46fdc7df6b74ecab6 100644 (file)
@@ -402,7 +402,7 @@ static struct folio *nfs_readdir_folio_get_locked(struct address_space *mapping,
        struct folio *folio;
 
        folio = filemap_grab_folio(mapping, index);
-       if (!folio)
+       if (IS_ERR(folio))
                return NULL;
        nfs_readdir_folio_init_and_validate(folio, cookie, change_attr);
        return folio;
This page took 0.054211 seconds and 4 git commands to generate.