linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Oscar Salvador <osalvador@suse.de>
Cc: oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [linux-next:master 6971/7658] mm/page_owner.c:860 stack_print() warn: unsigned 'nr_entries' is never less than zero.
Date: Fri, 16 Feb 2024 22:26:36 +0800	[thread overview]
Message-ID: <202402162252.FpEa3ZUY-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   d37e1e4c52bc60578969f391fb81f947c3e83118
commit: 3a6bc36161369a1772af565b59c6e290ee189afc [6971/7658] mm,page_owner: display all stacks and their count
config: x86_64-randconfig-161-20240215 (https://download.01.org/0day-ci/archive/20240216/202402162252.FpEa3ZUY-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402162252.FpEa3ZUY-lkp@intel.com/

smatch warnings:
mm/page_owner.c:860 stack_print() warn: unsigned 'nr_entries' is never less than zero.

vim +/nr_entries +860 mm/page_owner.c

   848	
   849	static int stack_print(struct seq_file *m, void *v)
   850	{
   851		int i;
   852		struct stack *stack = v;
   853		unsigned long *entries;
   854		unsigned long nr_entries;
   855		struct stack_record *stack_record = stack->stack_record;
   856	
   857		nr_entries = stack_record->size;
   858		entries = stack_record->entries;
   859	
 > 860		if (!nr_entries || nr_entries < 0 ||
   861		    refcount_read(&stack_record->count) < 2)
   862			return 0;
   863	
   864		for (i = 0; i < nr_entries; i++)
   865			seq_printf(m, " %pS\n", (void *)entries[i]);
   866		seq_printf(m, "stack_count: %d\n\n", refcount_read(&stack_record->count));
   867	
   868		return 0;
   869	}
   870	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


             reply	other threads:[~2024-02-16 14:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 14:26 kernel test robot [this message]
2024-02-16 14:52 ` Oscar Salvador

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=202402162252.FpEa3ZUY-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=osalvador@suse.de \
    /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