[PATCH 1/2] filemap: fix the conditional folio_put in filemap_fault
Matthew Wilcox
willy at infradead.org
Wed May 3 08:48:20 PDT 2023
On Wed, May 03, 2023 at 05:45:25PM +0200, Christoph Hellwig wrote:
> @@ -3372,14 +3372,14 @@ vm_fault_t filemap_fault(struct vm_fault *vmf)
>
> return VM_FAULT_SIGBUS;
>
> +out_retry_put_folio:
> + folio_put(folio);
> out_retry:
> /*
> * We dropped the mmap_lock, we need to return to the fault handler to
> * re-find the vma and come back and find our hopefully still populated
> * page.
> */
> - if (folio)
> - folio_put(folio);
Why not simply:
- if (folio)
+ if (!IS_ERR_OR_NULL(folio))
More information about the linux-afs
mailing list