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

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild-all,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   248951ddc14de84de3910f9b13f51491a8cd91df
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/20260722/[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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.