Re: [PATCH] mm: don't allow empty relative nodemask in mpol_relative_nodemask()

From: kernel test robot

Date: Fri May 29 2026 - 08:48:46 EST


Hi Yury,

kernel test robot noticed the following build warnings:

[auto build test WARNING on akpm-mm/mm-everything]

url: https://github.com/intel-lab-lkp/linux/commits/Yury-Norov/mm-don-t-allow-empty-relative-nodemask-in-mpol_relative_nodemask/20260529-030835
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20260528190337.878027-1-ynorov%40nvidia.com
patch subject: [PATCH] mm: don't allow empty relative nodemask in mpol_relative_nodemask()
config: sparc64-randconfig-002-20260529 (https://download.01.org/0day-ci/archive/20260529/202605292049.eaIv99hr-lkp@xxxxxxxxx/config)
compiler: sparc64-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260529/202605292049.eaIv99hr-lkp@xxxxxxxxx/reproduce)

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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605292049.eaIv99hr-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

mm/mempolicy.c: In function 'mpol_relative_nodemask':
>> mm/mempolicy.c:377:10: warning: 'return' with a value, in function returning void
return -EINVAL;
^
mm/mempolicy.c:370:13: note: declared here
static void mpol_relative_nodemask(nodemask_t *ret, const nodemask_t *orig,
^~~~~~~~~~~~~~~~~~~~~~


vim +/return +377 mm/mempolicy.c

369
370 static void mpol_relative_nodemask(nodemask_t *ret, const nodemask_t *orig,
371 const nodemask_t *rel)
372 {
373 unsigned int w = nodes_weight(*rel);
374 nodemask_t tmp;
375
376 if (w == 0)
> 377 return -EINVAL;
378
379 nodes_fold(tmp, *orig, w);
380 nodes_onto(*ret, tmp, *rel);
381 }
382

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