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))