Linux filesystem development
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: kbuild-all@lists.01.org, linux-fsdevel@vger.kernel.org
Subject: [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: Sun, 19 Jun 2022 23:40:37 +0800	[thread overview]
Message-ID: <202206192306.POJg04ej-lkp@intel.com> (raw)

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@intel.com/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@intel.com>

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

             reply	other threads:[~2022-06-19 15:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-19 15:40 kernel test robot [this message]
2022-06-19 15:48 ` [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 Al Viro
2022-06-19 15:54   ` Matthew Wilcox
2022-06-19 16:19     ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202206192306.POJg04ej-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox