Thanks for the report. The patch below takes care of it, and also uses the right type for a page index. Andrew, can you fold it in? diff --git a/drivers/gpu/drm/i915/gt/shmem_utils.c b/drivers/gpu/drm/i915/gt/shmem_utils.c index f011ea42487e11..4f043f2520f78d 100644 --- a/drivers/gpu/drm/i915/gt/shmem_utils.c +++ b/drivers/gpu/drm/i915/gt/shmem_utils.c @@ -52,7 +52,7 @@ struct file *shmem_create_from_object(struct drm_i915_gem_object *obj) void *shmem_pin_map(struct file *file) { struct page **pages; - size_t n_pages, i; + pgoff_t n_pages, i, j; void *vaddr; n_pages = file->f_mapping->host->i_size >> PAGE_SHIFT; @@ -73,8 +73,8 @@ void *shmem_pin_map(struct file *file) mapping_set_unevictable(file->f_mapping); return vaddr; err_page: - while (--i >= 0) - put_page(pages[i]); + for (j = 0; j < i; j++) + put_page(pages[j]); kvfree(pages); return NULL; }