From: Linus Torvalds Date: Tue, 9 May 2023 17:22:13 +0000 (-0700) Subject: nfs: fix another case of NULL/IS_ERR confusion wrt folio pointers X-Git-Tag: v6.6.17~4883 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=16a8829130ca22666ac6236178a6233208d425c3;p=platform%2Fkernel%2Flinux-rpi.git 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 Cc: Anna Schumaker Cc: Matthew Wilcox Cc: Christoph Hellwig Signed-off-by: Linus Torvalds --- diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index bacad0c..e63c1d4 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -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;