From: kernel test robot <lkp@intel.com>
To: Amery Hung <ameryhung@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Alexei Starovoitov <ast@kernel.org>
Subject: kernel/bpf/verifier.c:794:5-12: Unneeded variable: "ref_cnt". Return "0" on line 805
Date: Mon, 14 Sep 2026 11:08:31 +0200 [thread overview]
Message-ID: <202609141124.zR9pQCyK-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 704340f1cd0dcef829eb62f5b48ae95a2ce17bdf
commit: 2eee6fe8ac2cd21e931c009d475e5a8407d42d76 bpf: Fix dynptr ref counting to scan all call frames
date: 3 months ago
config: hexagon-randconfig-r054-20260914 (https://download.01.org/0day-ci/archive/20260914/202609141124.zR9pQCyK-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 707c032dae3bee24eae29c6f4c459a6d6dc6556d)
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: 2eee6fe8ac2c ("bpf: Fix dynptr ref counting to scan all call frames")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609141124.zR9pQCyK-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> kernel/bpf/verifier.c:794:5-12: Unneeded variable: "ref_cnt". Return "0" on line 805
vim +794 kernel/bpf/verifier.c
788
789 static int dynptr_ref_cnt(struct bpf_verifier_env *env, int v_parent_id)
790 {
791 struct bpf_stack_state *stack;
792 struct bpf_func_state *state;
793 struct bpf_reg_state *reg;
> 794 int ref_cnt = 0;
795
796 bpf_for_each_reg_in_vstate_mask(env->cur_state, state, reg, stack, 1 << STACK_DYNPTR, ({
797 if (!stack || stack->slot_type[0] != STACK_DYNPTR)
798 continue;
799 if (!stack->spilled_ptr.dynptr.first_slot)
800 continue;
801 if (stack->spilled_ptr.parent_id == v_parent_id)
802 ref_cnt++;
803 }));
804
> 805 return ref_cnt;
806 }
807
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-09-14 9:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202609141124.zR9pQCyK-lkp@intel.com \
--to=lkp@intel.com \
--cc=ameryhung@gmail.com \
--cc=ast@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.