All of lore.kernel.org
 help / color / mirror / Atom feed
* kernel/bpf/verifier.c:794:5-12: Unneeded variable: "ref_cnt". Return "0" on line 805
@ 2026-09-14  9:08 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-09-14  9:08 UTC (permalink / raw)
  To: Amery Hung; +Cc: oe-kbuild-all, linux-kernel, Alexei Starovoitov

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-14  9:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-14  9:08 kernel/bpf/verifier.c:794:5-12: Unneeded variable: "ref_cnt". Return "0" on line 805 kernel test robot

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.