[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210062319.93rlEYNS-lkp@intel.com>
Date: Thu, 6 Oct 2022 23:27:30 +0800
From: kernel test robot <lkp@...el.com>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org
Subject: [congwang:sch_bpf-kptr 3/5] net/sched/sch_bpf.c:186:3: warning:
variable 'cl' is uninitialized when used here
tree: https://github.com/congwang/linux.git sch_bpf-kptr
head: efc61283d209bbec088ffc83043b9320534faa62
commit: e15fc84b6c56582f8dce2101e7ba9b634681e956 [3/5] net_sched: introduce eBPF based Qdisc
config: i386-allyesconfig
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/congwang/linux/commit/e15fc84b6c56582f8dce2101e7ba9b634681e956
git remote add congwang https://github.com/congwang/linux.git
git fetch --no-tags congwang sch_bpf-kptr
git checkout e15fc84b6c56582f8dce2101e7ba9b634681e956
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/media/cec/usb/ net/sched/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> net/sched/sch_bpf.c:186:3: warning: variable 'cl' is uninitialized when used here [-Wuninitialized]
cl->overlimits++;
^~
net/sched/sch_bpf.c:171:26: note: initialize the variable 'cl' to silence this warning
struct sch_bpf_class *cl;
^
= NULL
1 warning generated.
vim +/cl +186 net/sched/sch_bpf.c
164
165 static struct sk_buff *sch_bpf_dequeue(struct Qdisc *sch)
166 {
167 struct sch_bpf_qdisc *q = qdisc_priv(sch);
168 struct sk_buff *ret = NULL;
169 struct sch_bpf_ctx ctx = {};
170 struct bpf_prog *dequeue;
171 struct sch_bpf_class *cl;
172 s64 now;
173 int res;
174
175 dequeue = rcu_dereference(q->dequeue_prog.prog);
176 ctx.classid = sch->handle;
177 res = bpf_prog_run(dequeue, &ctx);
178 switch (res) {
179 case SCH_BPF_DEQUEUED:
180 ret = (struct sk_buff *)ctx.skb;
181 break;
182 case SCH_BPF_THROTTLE:
183 now = ktime_get_ns();
184 qdisc_watchdog_schedule_ns(&q->watchdog, now + ctx.delay);
185 qdisc_qstats_overlimit(sch);
> 186 cl->overlimits++;
187 return NULL;
188 case SCH_BPF_PASS:
189 cl = sch_bpf_find(sch, ctx.classid);
190 if (!cl || !cl->qdisc)
191 return NULL;
192 ret = qdisc_dequeue_peeked(cl->qdisc);
193 if (ret) {
194 qdisc_bstats_update(sch, ret);
195 qdisc_qstats_backlog_dec(sch, ret);
196 sch->q.qlen--;
197 }
198 }
199
200 return ret;
201 }
202
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (280941 bytes)
Powered by blists - more mailing lists