[PATCH v4 2/2] clk: clocking-wizard: add user clock monitor support

Harry Austen hpausten at protonmail.com
Fri Feb 20 06:33:04 PST 2026


On Thu Feb 19, 2026 at 6:52 AM GMT, Dan Carpenter wrote:
> Hi Harry,
>
> kernel test robot noticed the following build warnings:
>
> url:    https://github.com/intel-lab-lkp/linux/commits/Harry-Austen/dt-bindings-clock-xilinx-add-description-of-user-monitor-interrupt/20260215-021554
> base:   ea7282e99ead6d2a294cef40acd2a29ada3ab71d
> patch link:    https://lore.kernel.org/r/20260214180933.42143-3-hpausten%40protonmail.com
> patch subject: [PATCH v4 2/2] clk: clocking-wizard: add user clock monitor support
> config: microblaze-randconfig-r072-20260215 (https://download.01.org/0day-ci/archive/20260215/202602151704.qepyfVlc-lkp@intel.com/config)
> compiler: microblaze-linux-gcc (GCC) 14.3.0
> smatch version: v0.5.0-8994-gd50c5a4c
>
> 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 at intel.com>
> | Reported-by: Dan Carpenter <dan.carpenter at linaro.org>
> | Closes: https://lore.kernel.org/r/202602151704.qepyfVlc-lkp@intel.com/
>
> smatch warnings:
> drivers/clk/xilinx/clk-xlnx-clock-wizard.c:1183 clk_wzrd_user_mon_work() error: dereferencing freed memory 'dump' (line 1182)
>
> vim +/dump +1183 drivers/clk/xilinx/clk-xlnx-clock-wizard.c
>
> 68614f228e6cbe Harry Austen 2026-02-14  1176  static void clk_wzrd_user_mon_work(struct work_struct *work)
> 68614f228e6cbe Harry Austen 2026-02-14  1177  {
> 68614f228e6cbe Harry Austen 2026-02-14  1178  	struct clk_wzrd *clk_wzrd = container_of(work, struct clk_wzrd, work.work);
> 68614f228e6cbe Harry Austen 2026-02-14  1179  	u32 *dump = vmalloc(WZRD_NUM_DUMP_REGS * sizeof(*dump));
> 68614f228e6cbe Harry Austen 2026-02-14  1180
> 68614f228e6cbe Harry Austen 2026-02-14  1181  	ioread32_rep(clk_wzrd->base, dump, WZRD_NUM_DUMP_REGS);
> 68614f228e6cbe Harry Austen 2026-02-14 @1182  	dev_coredumpv(&clk_wzrd->pdev->dev, dump, WZRD_NUM_DUMP_REGS * sizeof(*dump), GFP_KERNEL);
> 68614f228e6cbe Harry Austen 2026-02-14 @1183  	iowrite32(dump[WZRD_INTR_STATUS / sizeof(*dump)], clk_wzrd->base + WZRD_INTR_STATUS);
>                                                           ^^^^
> dev_coredumpv() can free dump.

Whoops. That makes total sense. Pretty sure this can be easily resolved by moving the
dev_coredumpv call after iowrite32. Will do in next patch version.

>
> 68614f228e6cbe Harry Austen 2026-02-14  1184  }
> 68614f228e6cbe Harry Austen 2026-02-14  1185
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki

Thanks for the report!
Harry




More information about the linux-arm-kernel mailing list