Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 16a8829

Browse files
committed
nfs: fix another case of NULL/IS_ERR confusion wrt folio pointers
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]>
1 parent 1dc3731 commit 16a8829

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ static struct folio *nfs_readdir_folio_get_locked(struct address_space *mapping,
402402
struct folio *folio;
403403

404404
folio = filemap_grab_folio(mapping, index);
405-
if (!folio)
405+
if (IS_ERR(folio))
406406
return NULL;
407407
nfs_readdir_folio_init_and_validate(folio, cookie, change_attr);
408408
return folio;

0 commit comments

Comments
 (0)