Hi Jinjie,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.6-rc3 next-20230926]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    
https://github.com/intel-lab-lkp/linux/commits/Jinjie-Ruan/kunit-Fix-missed-memory-release-in-kunit_free_suite_set/20230922-151243
base:   linus/master
patch link:    
https://lore.kernel.org/r/20230922071020.2554677-5-ruanjinjie%40huawei.com
patch subject: [PATCH v3 4/4] kunit: test: Fix the possible memory leak in 
executor_test
config: powerpc-allyesconfig 
(https://download.01.org/0day-ci/archive/20230927/[email protected]/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 
4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): 
(https://download.01.org/0day-ci/archive/20230927/[email protected]/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 <[email protected]>
| Closes: 
https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

   In file included from lib/kunit/executor.c:353:
>> lib/kunit/executor_test.c:278:4: warning: cast from 'void (*)(struct 
>> kunit_suite_set *)' to 'kunit_action_t *' (aka 'void (*)(void *)') converts 
>> to incompatible function type [-Wcast-function-type-strict]
     278 |                         (kunit_action_t *)free_suite_set,
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +278 lib/kunit/executor_test.c

   264  
   265  /* Use the resource API to register a call to free_suite_set.
   266   * Since we never actually use the resource, it's safe to use on const 
data.
   267   */
   268  static void free_suite_set_at_end(struct kunit *test, const void 
*to_free)
   269  {
   270          if (!((struct kunit_suite_set *)to_free)->start)
   271                  return;
   272  
   273          struct kunit_suite_set *free = kzalloc(sizeof(struct 
kunit_suite_set),
   274                                                 GFP_KERNEL);
   275          *free = *(struct kunit_suite_set *)to_free;
   276  
   277          kunit_add_action(test,
 > 278                          (kunit_action_t *)free_suite_set,
   279                          (void *)free);
   280  }
   281  

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

Reply via email to