Thread (3 messages) 3 messages, 2 authors, 2025-01-10

Re: [PATCH] ftrace: Implement :mod: cache filtering on kernel command line

From: kernel test robot <hidden>
Date: 2025-01-10 19:59:00
Also in: lkml, llvm, oe-kbuild-all

Hi Steven,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.13-rc6 next-20250110]
[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/Steven-Rostedt/ftrace-Implement-mod-cache-filtering-on-kernel-command-line/20250110-064649
base:   linus/master
patch link:    https://lore.kernel.org/r/20250109174639.32e6f43a%40gandalf.local.home
patch subject: [PATCH] ftrace: Implement :mod: cache filtering on kernel command line
config: i386-randconfig-013-20250111 (https://download.01.org/0day-ci/archive/20250111/202501110314.8tTxSS0N-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250111/202501110314.8tTxSS0N-lkp@intel.com/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 [off-list ref]
| Closes: https://lore.kernel.org/oe-kbuild-all/202501110314.8tTxSS0N-lkp@intel.com/ (local)

All warnings (new ones prefixed by >>):
quoted
kernel/trace/ftrace.c:6232:6: warning: variable 'mod' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    6232 |         if (next) {
         |             ^~~~
   kernel/trace/ftrace.c:6246:67: note: uninitialized use occurs here
    6246 |         ret = ftrace_set_hash(ops, func, len, NULL, 0, 0, reset, enable, mod);
         |                                                                          ^~~
   kernel/trace/ftrace.c:6232:2: note: remove the 'if' if its condition is always true
    6232 |         if (next) {
         |         ^~~~~~~~~
   kernel/trace/ftrace.c:6224:11: note: initialize the variable 'mod' to silence this warning
    6224 |         char *mod, *func, *command, *next = buf;
         |                  ^
         |                   = NULL
   1 warning generated.


vim +6232 kernel/trace/ftrace.c

  6219	
  6220	static int
  6221	ftrace_set_regex(struct ftrace_ops *ops, unsigned char *buf, int len,
  6222			 int reset, int enable)
  6223	{
  6224		char *mod, *func, *command, *next = buf;
  6225		char *tmp __free(kfree) = NULL;
  6226		struct trace_array *tr = ops->private;
  6227		int ret;
  6228	
  6229		func = strsep(&next, ":");
  6230	
  6231		/* This can also handle :mod: parsing */
6232		if (next) {
  6233			if (!tr)
  6234				return -EINVAL;
  6235	
  6236			command = strsep(&next, ":");
  6237			if (strcmp(command, "mod") != 0)
  6238				return -EINVAL;
  6239	
  6240			mod = next;
  6241			len = command - func;
  6242			/* Save the original func as ftrace_set_hash() can modify it */
  6243			tmp = kstrdup(func, GFP_KERNEL);
  6244		}
  6245	
  6246		ret = ftrace_set_hash(ops, func, len, NULL, 0, 0, reset, enable, mod);
  6247	
  6248		if (tr && mod && ret < 0) {
  6249			/* Did tmp fail to allocate? */
  6250			if (!tmp)
  6251				return -ENOMEM;
  6252			ret = cache_mod(tr, tmp, mod, enable);
  6253		}
  6254	
  6255		return ret;
  6256	}
  6257	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help