Re: [PATCH next] drm/i915: Fix NULL vs IS_ERR() check in __shmem_writeback()
From: Andi Shyti
Date: Fri Feb 07 2025 - 06:03:05 EST
Hi Dan,
On Thu, Feb 06, 2025 at 11:17:02AM +0300, Dan Carpenter wrote:
> The filemap_lock_folio() function doesn't return NULL, it returns error
> pointers.
>
> Fixes: 25dd342f0cc8 ("drm/i915/gem: convert __shmem_writeback() to folios")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> ---
> drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
> index a784fb44e59c..fb263b421958 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
> @@ -319,7 +319,7 @@ void __shmem_writeback(size_t size, struct address_space *mapping)
> struct folio *folio;
>
> folio = filemap_lock_folio(mapping, i);
> - if (!folio)
> + if (IS_ERR(folio))
I don't see this patch yet in -next yet (and of course not in
drm-tip), which branch is it based on?
Thanks,
Andi
> continue;
>
> if (!folio_mapped(folio) && folio_clear_dirty_for_io(folio)) {
> --
> 2.47.2