Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <dan.carpenter@linaro.org>
Cc: Anna Schumaker <anna@kernel.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+1 -1
+1 -1
fs/nfs/dir.c
··· 402 402 struct folio *folio; 403 403 404 404 folio = filemap_grab_folio(mapping, index); 405 - if (!folio) 405 + if (IS_ERR(folio)) 406 406 return NULL; 407 407 nfs_readdir_folio_init_and_validate(folio, cookie, change_attr); 408 408 return folio;