Skip to contentSkip to conversation

drivers/power/reset/reboot-mode.c:39:2-7: WARNING: invalid free of devm_ allocated data

DISCUSSION kernel test robot 1 participant 1 message Jul 19

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   94515f3a7d4256a5062176b7d6ed0471938cd51a
commit: cfaf0a90789ac74391ac7583c86cdaaada78cdbb power: reset: reboot-mode: Expose sysfs for registered reboot_modes
date:   5 months ago
config: powerpc64-randconfig-r064-20260716 (https://download.01.org/0day-ci/archive/20260719/[email protected]/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project b3e6e6dabdc02153552a64fc74ff5c7532447eed)

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

| Fixes: cfaf0a90789a ("power: reset: reboot-mode: Expose sysfs for registered reboot_modes")
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

cocci warnings: (new ones prefixed by >>)

>> drivers/power/reset/reboot-mode.c:39:2-7: WARNING: invalid free of devm_ allocated data

vim +39 drivers/power/reset/reboot-mode.c

    30	
    31	static inline void reboot_mode_release_list(struct reboot_mode_sysfs_data *priv)
    32	{
    33		struct mode_info *info;
    34		struct mode_info *next;
    35	
    36		list_for_each_entry_safe(info, next, &priv->head, list) {
    37			list_del(&info->list);
    38			kfree_const(info->mode);
  > 39			kfree(info);
    40		}
    41	}
    42	

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