Skip to contentSkip to conversation

kernel/events/uprobes.c:718 hprobe_consume() error: uninitialized symbol 'state'.

PATCH kernel test robot 1 participant 1 message Oct 30, 2024

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw

BCC: [email protected]
CC: [email protected]
TO: Andrii Nakryiko <[email protected]>
CC: Peter Zijlstra <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git perf/core
head:   72a27524a4939fc0958796a46b51c1fab3729367
commit: 72a27524a4939fc0958796a46b51c1fab3729367 [21/21] uprobes: SRCU-protect uretprobe lifetime (with timeout)

:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: i386-randconfig-141-20241030 (https://download.01.org/0day-ci/archive/20241030/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

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 <[email protected]>
| Reported-by: Dan Carpenter <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

smatch warnings:
kernel/events/uprobes.c:718 hprobe_consume() error: uninitialized symbol 'state'.

vim +/state +718 kernel/events/uprobes.c

72a27524a4939f Andrii Nakryiko 2024-10-23  695  
72a27524a4939f Andrii Nakryiko 2024-10-23  696  /*
72a27524a4939f Andrii Nakryiko 2024-10-23  697   * hprobe_consume() fetches hprobe's underlying uprobe and detects whether
72a27524a4939f Andrii Nakryiko 2024-10-23  698   * uprobe is SRCU protected or is refcounted. hprobe_consume() can be
72a27524a4939f Andrii Nakryiko 2024-10-23  699   * used only once for a given hprobe.
72a27524a4939f Andrii Nakryiko 2024-10-23  700   *
72a27524a4939f Andrii Nakryiko 2024-10-23  701   * Caller has to call hprobe_finalize() and pass previous hprobe_state, so
72a27524a4939f Andrii Nakryiko 2024-10-23  702   * that hprobe_finalize() can perform SRCU unlock or put uprobe, whichever
72a27524a4939f Andrii Nakryiko 2024-10-23  703   * is appropriate.
72a27524a4939f Andrii Nakryiko 2024-10-23  704   */
72a27524a4939f Andrii Nakryiko 2024-10-23  705  static inline struct uprobe *hprobe_consume(struct hprobe *hprobe, enum hprobe_state *hstate)
72a27524a4939f Andrii Nakryiko 2024-10-23  706  {
72a27524a4939f Andrii Nakryiko 2024-10-23  707  	enum hprobe_state state;
72a27524a4939f Andrii Nakryiko 2024-10-23  708  
72a27524a4939f Andrii Nakryiko 2024-10-23  709  	*hstate = xchg(&hprobe->state, HPROBE_CONSUMED);
72a27524a4939f Andrii Nakryiko 2024-10-23  710  	switch (*hstate) {
72a27524a4939f Andrii Nakryiko 2024-10-23  711  	case HPROBE_LEASED:
72a27524a4939f Andrii Nakryiko 2024-10-23  712  	case HPROBE_STABLE:
72a27524a4939f Andrii Nakryiko 2024-10-23  713  		return hprobe->uprobe;
72a27524a4939f Andrii Nakryiko 2024-10-23  714  	case HPROBE_GONE:	/* uprobe is NULL, no SRCU */
72a27524a4939f Andrii Nakryiko 2024-10-23  715  	case HPROBE_CONSUMED:	/* uprobe was finalized already, do nothing */
72a27524a4939f Andrii Nakryiko 2024-10-23  716  		return NULL;
72a27524a4939f Andrii Nakryiko 2024-10-23  717  	default:
72a27524a4939f Andrii Nakryiko 2024-10-23 @718  		WARN(1, "hprobe invalid state %d", state);
72a27524a4939f Andrii Nakryiko 2024-10-23  719  		return NULL;
72a27524a4939f Andrii Nakryiko 2024-10-23  720  	}
72a27524a4939f Andrii Nakryiko 2024-10-23  721  }

72a27524a4939f Andrii Nakryiko 2024-10-23 722

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki