* [jolsa-perf:uprobe_multi_2 1/22] kernel/trace/bpf_trace.c:3041:16: warning: variable 'inode' set but not used
@ 2023-05-27 23:37 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-05-27 23:37 UTC (permalink / raw)
To: Jiri Olsa; +Cc: llvm, oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git uprobe_multi_2
head: c8f1191093bc581ca849b4e106d98b69bdc3a9fd
commit: cd4ef19c217089e0b5af3754c9b5915780926c9b [1/22] bpf: Add multi uprobe link
config: x86_64-randconfig-x063-20230528 (https://download.01.org/0day-ci/archive/20230528/202305280743.W2Qij9if-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
mkdir -p ~/bin
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git/commit/?id=cd4ef19c217089e0b5af3754c9b5915780926c9b
git remote add jolsa-perf https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
git fetch --no-tags jolsa-perf uprobe_multi_2
git checkout cd4ef19c217089e0b5af3754c9b5915780926c9b
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash kernel/trace/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202305280743.W2Qij9if-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> kernel/trace/bpf_trace.c:3041:16: warning: variable 'inode' set but not used [-Wunused-but-set-variable]
struct inode *inode, *old_inode;
^
>> kernel/trace/bpf_trace.c:3092:12: warning: variable 'old_inode' is uninitialized when used here [-Wuninitialized]
inode = old_inode;
^~~~~~~~~
kernel/trace/bpf_trace.c:3041:33: note: initialize the variable 'old_inode' to silence this warning
struct inode *inode, *old_inode;
^
= NULL
2 warnings generated.
vim +/inode +3041 kernel/trace/bpf_trace.c
3032
3033 int bpf_uprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *prog)
3034 {
3035 void __user **upaths, __user *upath, __user *old_upath = NULL;
3036 unsigned long __user *uref_ctr_offsets, ref_ctr_offset = 0;
3037 struct bpf_uprobe_multi_link *link = NULL;
3038 unsigned long __user *uoffsets, offset;
3039 struct bpf_link_primer link_primer;
3040 struct bpf_uprobe *uprobes = NULL;
> 3041 struct inode *inode, *old_inode;
3042 u32 flags, cnt, i;
3043 struct path path;
3044 int err;
3045
3046 /* no support for 32bit archs yet */
3047 if (sizeof(u64) != sizeof(void *))
3048 return -EOPNOTSUPP;
3049
3050 if (prog->expected_attach_type != BPF_TRACE_UPROBE_MULTI)
3051 return -EINVAL;
3052
3053 flags = attr->link_create.uprobe_multi.flags;
3054 if (flags & ~BPF_F_UPROBE_MULTI_RETURN)
3055 return -EINVAL;
3056
3057 upaths = u64_to_user_ptr(attr->link_create.uprobe_multi.paths);
3058 uoffsets = u64_to_user_ptr(attr->link_create.uprobe_multi.offsets);
3059 if (!!upaths != !!uoffsets)
3060 return -EINVAL;
3061
3062 uref_ctr_offsets = u64_to_user_ptr(attr->link_create.uprobe_multi.ref_ctr_offsets);
3063
3064 cnt = attr->link_create.uprobe_multi.cnt;
3065 if (!cnt)
3066 return -EINVAL;
3067
3068 uprobes = kvcalloc(cnt, sizeof(*uprobes), GFP_KERNEL);
3069 if (!uprobes)
3070 return -ENOMEM;
3071
3072 link = kzalloc(sizeof(*link), GFP_KERNEL);
3073 if (!link) {
3074 err = -ENOMEM;
3075 goto error;
3076 }
3077
3078 for (i = 0; i < cnt; i++) {
3079 if (uref_ctr_offsets && __get_user(ref_ctr_offset, uref_ctr_offsets + i)) {
3080 err = -EFAULT;
3081 goto error_path_put;
3082 }
3083 if (__get_user(offset, uoffsets + i)) {
3084 err = -EFAULT;
3085 goto error_path_put;
3086 }
3087 if (__get_user(upath, upaths + i)) {
3088 err = -EFAULT;
3089 goto error_path_put;
3090 }
3091 if (i && old_upath == upath) {
> 3092 inode = old_inode;
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-05-27 23:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-27 23:37 [jolsa-perf:uprobe_multi_2 1/22] kernel/trace/bpf_trace.c:3041:16: warning: variable 'inode' set but not used kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox