[viro-vfs:work.iov_iter_get_pages 24/33] lib/iov_iter.c:1295 iter_xarray_get_pages() warn: unsigned 'count' is never less than zero.

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.iov_iter_get_pages
head:   fe8e2809c7db0ec65403b31b50906f3f481a9b10
commit: e64d637d648390e4ac0643747ae174c3be15f243 [24/33] iov_iter: saner helper for page array allocation
config: mips-randconfig-m031-20220619 (https://download.01.org/0day-ci/archive/20220619/202206192306.POJg04ej-lkp@xxxxxxxxx/config)
compiler: mips-linux-gcc (GCC) 11.3.0

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

smatch warnings:
lib/iov_iter.c:1295 iter_xarray_get_pages() warn: unsigned 'count' is never less than zero.

vim +/count +1295 lib/iov_iter.c

  1280	
  1281	static ssize_t iter_xarray_get_pages(struct iov_iter *i,
  1282					     struct page ***pages, size_t maxsize,
  1283					     unsigned maxpages, size_t *_start_offset)
  1284	{
  1285		unsigned nr, offset;
  1286		pgoff_t index, count;
  1287		loff_t pos;
  1288	
  1289		pos = i->xarray_start + i->iov_offset;
  1290		index = pos >> PAGE_SHIFT;
  1291		offset = pos & ~PAGE_MASK;
  1292		*_start_offset = offset;
  1293	
  1294		count = want_pages_array(pages, maxsize, offset, maxpages);
> 1295		if (count < 0)
  1296			return count;
  1297		nr = iter_xarray_populate_pages(*pages, i->xarray, index, count);
  1298		if (nr == 0)
  1299			return 0;
  1300	
  1301		return min_t(size_t, nr * PAGE_SIZE - offset, maxsize);
  1302	}
  1303	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux