[linux-next:master 13152/13159] drivers/gpu/drm/i915/gt/shmem_utils.c:76 shmem_pin_map() warn: always true condition '(--i >= 0) => (0-u64max >= 0)'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   2172e358cd1713c5b7c31361ac465edfe55e455c
commit: 400b65cb5acbcbe227c95f098349e02f77e04d88 [13152/13159] drm/i915: use vmap in shmem_pin_map
config: x86_64-randconfig-m001-20201004 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

smatch warnings:
drivers/gpu/drm/i915/gt/shmem_utils.c:76 shmem_pin_map() warn: always true condition '(--i >= 0) => (0-u64max >= 0)'
drivers/gpu/drm/i915/gt/shmem_utils.c:76 shmem_pin_map() warn: always true condition '(--i >= 0) => (0-u64max >= 0)'

vim +76 drivers/gpu/drm/i915/gt/shmem_utils.c

    51	
    52	void *shmem_pin_map(struct file *file)
    53	{
    54		struct page **pages;
    55		size_t n_pages, i;
    56		void *vaddr;
    57	
    58		n_pages = file->f_mapping->host->i_size >> PAGE_SHIFT;
    59		pages = kvmalloc_array(n_pages, sizeof(*pages), GFP_KERNEL);
    60		if (!pages)
    61			return NULL;
    62	
    63		for (i = 0; i < n_pages; i++) {
    64			pages[i] = shmem_read_mapping_page_gfp(file->f_mapping, i,
    65							       GFP_KERNEL);
    66			if (IS_ERR(pages[i]))
    67				goto err_page;
    68		}
    69	
    70		vaddr = vmap(pages, n_pages, VM_MAP_PUT_PAGES, PAGE_KERNEL);
    71		if (!vaddr)
    72			goto err_page;
    73		mapping_set_unevictable(file->f_mapping);
    74		return vaddr;
    75	err_page:
  > 76		while (--i >= 0)
    77			put_page(pages[i]);
    78		kvfree(pages);
    79		return NULL;
    80	}
    81	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux